org.apache.ignite.internal.processors.clock

## Class GridClockSyncProcessor

- java.lang.Object
- - org.apache.ignite.internal.processors.GridProcessorAdapter
  - - org.apache.ignite.internal.processors.clock.GridClockSyncProcessor

All Implemented Interfaces:
  GridComponent, GridProcessor

    public class GridClockSyncProcessor
    extends GridProcessorAdapter

Time synchronization processor.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent

`GridComponent.DiscoveryDataExchangeType`

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`ctx, log`

### Constructor Summary

Constructors
Constructor and Description
`GridClockSyncProcessor(GridKernalContext ctx)`

### Method Summary

Methods
`long` `adjustedTime(long topVer)` Gets time adjusted with time coordinator on given topology version.
`void` `onKernalStart()` Callback that notifies that kernal has successfully started, including all managers and processors.
`void` `onKernalStop(boolean cancel)` Callback to notify that kernal is about to stop.
`void` `onMessageReceived(GridClockMessage msg, InetAddress addr, int port)` Callback from server for message receiving.
`void` `start()` Starts grid component.
`void` `stop(boolean cancel)` Stops grid component.
`NavigableMap<GridClockDeltaVersion,GridClockDeltaSnapshot>` `timeSyncHistory()`

### Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`assertParameter, collectDiscoveryData, discoveryDataType, onDisconnected, onDiscoveryDataReceived, onReconnected, printMemoryStats, toString, validateNode`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### GridClockSyncProcessor

    public GridClockSyncProcessor(GridKernalContext ctx)

Parameters:
  `ctx` - Kernal context.

### Method Detail

#### start

    public void start()
               throws IgniteCheckedException

Starts grid component.

Specified by:
  `start` in interface `GridComponent`
Overrides:
  `start` in class `GridProcessorAdapter`
Throws:
  `IgniteCheckedException` - Throws in case of any errors.

#### onKernalStart

    public void onKernalStart()
                       throws IgniteCheckedException

Callback that notifies that kernal has successfully started, including all managers and processors.

Specified by:
  `onKernalStart` in interface `GridComponent`
Overrides:
  `onKernalStart` in class `GridProcessorAdapter`
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### onKernalStop

    public void onKernalStop(boolean cancel)

Callback to notify that kernal is about to stop.

Specified by:
  `onKernalStop` in interface `GridComponent`
Overrides:
  `onKernalStop` in class `GridProcessorAdapter`
Parameters:
  `cancel` - Flag indicating whether jobs should be canceled.

#### stop

    public void stop(boolean cancel)
              throws IgniteCheckedException

Stops grid component.

Specified by:
  `stop` in interface `GridComponent`
Overrides:
  `stop` in class `GridProcessorAdapter`
Parameters:
  `cancel` - If `true`, then all ongoing tasks or jobs for relevant components need to be cancelled.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### timeSyncHistory

    public NavigableMap<GridClockDeltaVersion,GridClockDeltaSnapshot> timeSyncHistory()

Returns:
  Time sync history.

#### onMessageReceived

    public void onMessageReceived(GridClockMessage msg,
                         InetAddress addr,
                         int port)

Callback from server for message receiving.

Parameters:
  `msg` - Received message.
  `addr` - Remote node address.
  `port` - Remote node port.

#### adjustedTime

    public long adjustedTime(long topVer)

Gets time adjusted with time coordinator on given topology version.

Parameters:
  `topVer` - Topology version.
Returns:
  Adjusted time.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.4.0
Release Date | : September 24 2015