Package com.linkedin.venice.controller
Class ZkExecutionIdAccessor
- java.lang.Object
-
- com.linkedin.venice.controller.ZkExecutionIdAccessor
-
- All Implemented Interfaces:
ExecutionIdAccessor
public class ZkExecutionIdAccessor extends java.lang.Object implements ExecutionIdAccessor
-
-
Constructor Summary
Constructors Constructor Description ZkExecutionIdAccessor(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer adapterSerializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Long
getLastGeneratedExecutionId(java.lang.String clusterName)
Get the last id which is generated by execution tracker in the give cluster.java.lang.Long
getLastSucceededExecutionId(java.lang.String clusterName)
Get the id for the last succeed operation in the given cluster.java.util.Map<java.lang.String,java.lang.Long>
getLastSucceededExecutionIdMap(java.lang.String clusterName)
Get the execution id map that contains the last succeeded operation in the given cluster for each store.java.lang.Long
incrementAndGetExecutionId(java.lang.String clusterName)
Using AtomicLong here only as a workaround to get next execution id fromHelixUtils.compareAndUpdate(ZkBaseDataAccessor, String, int, DataUpdater)
void
updateLastGeneratedExecutionId(java.lang.String clusterName, java.lang.Long lastGeneratedExecutionId)
Update the last id which is generated by execution tracker in the given cluster.void
updateLastSucceededExecutionId(java.lang.String clusterName, java.lang.Long lastSucceedExecutionId)
Update the id of the last succeed operation in the given cluster.void
updateLastSucceededExecutionIdMap(java.lang.String clusterName, java.lang.String storeName, java.lang.Long lastSucceededExecutionId)
Update the execution id map that contains the last succeeded operation in the given cluster for each store.
-
-
-
Constructor Detail
-
ZkExecutionIdAccessor
public ZkExecutionIdAccessor(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer adapterSerializer)
-
-
Method Detail
-
getLastSucceededExecutionId
public java.lang.Long getLastSucceededExecutionId(java.lang.String clusterName)
Description copied from interface:ExecutionIdAccessor
Get the id for the last succeed operation in the given cluster.- Specified by:
getLastSucceededExecutionId
in interfaceExecutionIdAccessor
- See Also:
ExecutionIdAccessor.getLastSucceededExecutionId(String)
-
updateLastSucceededExecutionId
public void updateLastSucceededExecutionId(java.lang.String clusterName, java.lang.Long lastSucceedExecutionId)
Description copied from interface:ExecutionIdAccessor
Update the id of the last succeed operation in the given cluster.- Specified by:
updateLastSucceededExecutionId
in interfaceExecutionIdAccessor
- See Also:
ExecutionIdAccessor.updateLastSucceededExecutionId(String, Long)
-
getLastSucceededExecutionIdMap
public java.util.Map<java.lang.String,java.lang.Long> getLastSucceededExecutionIdMap(java.lang.String clusterName)
Description copied from interface:ExecutionIdAccessor
Get the execution id map that contains the last succeeded operation in the given cluster for each store.- Specified by:
getLastSucceededExecutionIdMap
in interfaceExecutionIdAccessor
- See Also:
ExecutionIdAccessor.getLastSucceededExecutionIdMap(String)
-
updateLastSucceededExecutionIdMap
public void updateLastSucceededExecutionIdMap(java.lang.String clusterName, java.lang.String storeName, java.lang.Long lastSucceededExecutionId)
Description copied from interface:ExecutionIdAccessor
Update the execution id map that contains the last succeeded operation in the given cluster for each store.- Specified by:
updateLastSucceededExecutionIdMap
in interfaceExecutionIdAccessor
- See Also:
ExecutionIdAccessor.updateLastSucceededExecutionIdMap(String, String, Long)
-
getLastGeneratedExecutionId
public java.lang.Long getLastGeneratedExecutionId(java.lang.String clusterName)
Description copied from interface:ExecutionIdAccessor
Get the last id which is generated by execution tracker in the give cluster.- Specified by:
getLastGeneratedExecutionId
in interfaceExecutionIdAccessor
- See Also:
ExecutionIdAccessor.getLastGeneratedExecutionId(String)
-
updateLastGeneratedExecutionId
public void updateLastGeneratedExecutionId(java.lang.String clusterName, java.lang.Long lastGeneratedExecutionId)
Description copied from interface:ExecutionIdAccessor
Update the last id which is generated by execution tracker in the given cluster.- Specified by:
updateLastGeneratedExecutionId
in interfaceExecutionIdAccessor
- See Also:
ExecutionIdAccessor.updateLastGeneratedExecutionId(String, Long)
-
incrementAndGetExecutionId
public java.lang.Long incrementAndGetExecutionId(java.lang.String clusterName)
Using AtomicLong here only as a workaround to get next execution id fromHelixUtils.compareAndUpdate(ZkBaseDataAccessor, String, int, DataUpdater)
- Specified by:
incrementAndGetExecutionId
in interfaceExecutionIdAccessor
- Returns:
- updated execution id.
- Throws:
ZkDataAccessException
- will be thrown if it fails to update the data
-
-