Package org.cdlib.mrt.zk
Class QueueItem
- java.lang.Object
-
- org.cdlib.mrt.zk.QueueItem
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQueueItem.BatchJobStatesStandardized path names for Merritt Zookeeper nodesstatic classQueueItem.ZkPathsStandardized path names for Merritt Zookeeper nodesstatic classQueueItem.ZkPrefixesStandardized prefix names for Merritt Zookeeper sequential nodes
-
Field Summary
Fields Modifier and Type Field Description protected org.json.JSONObjectdata
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcreateData(org.apache.zookeeper.ZooKeeper client, ZKKey key, Object data)voidcreateOrSetData(org.apache.zookeeper.ZooKeeper client, ZKKey key, Object data)org.json.JSONObjectdata()abstract voiddelete(org.apache.zookeeper.ZooKeeper client)abstract Stringdir()Stringid()intintProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key)static ObjectjsonDataProperty(org.json.JSONObject obj, MerrittJsonKey key, Object dval)static intjsonIntProperty(org.json.JSONObject obj, MerrittJsonKey key, int dval)static longjsonLongProperty(org.json.JSONObject obj, MerrittJsonKey key, long dval)org.json.JSONObjectjsonProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key)static StringjsonStringProperty(org.json.JSONObject obj, MerrittJsonKey key, String dval)QueueItemload(org.apache.zookeeper.ZooKeeper client)voidloadProperties(org.apache.zookeeper.ZooKeeper client)voidloadStatus(org.apache.zookeeper.ZooKeeper client, org.json.JSONObject js)booleanlock(org.apache.zookeeper.ZooKeeper client)longlongProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key)StringmakePath(ZKKey key)org.json.JSONObjectoptJsonProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key)StringoptStringProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key)Stringpath()abstract Stringprefix()abstract IngestStateresolveStatus(String s)voidsetData(org.apache.zookeeper.ZooKeeper client, ZKKey key, Object data)voidsetStatus(org.apache.zookeeper.ZooKeeper client, IngestState status)voidsetStatus(org.apache.zookeeper.ZooKeeper client, IngestState status, String message)voidsetStatusTrigger(org.apache.zookeeper.ZooKeeper client)abstract IngestState[]states()IngestStatestatus()org.json.JSONObjectstatusObject(IngestState status)StringstringProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key)booleanunlock(org.apache.zookeeper.ZooKeeper client)
-
-
-
Method Detail
-
id
public String id()
-
data
public org.json.JSONObject data()
-
jsonDataProperty
public static Object jsonDataProperty(org.json.JSONObject obj, MerrittJsonKey key, Object dval)
-
jsonStringProperty
public static String jsonStringProperty(org.json.JSONObject obj, MerrittJsonKey key, String dval)
-
jsonIntProperty
public static int jsonIntProperty(org.json.JSONObject obj, MerrittJsonKey key, int dval)
-
jsonLongProperty
public static long jsonLongProperty(org.json.JSONObject obj, MerrittJsonKey key, long dval)
-
states
public abstract IngestState[] states()
-
status
public IngestState status()
-
dir
public abstract String dir()
-
prefix
public abstract String prefix()
-
path
public String path()
-
load
public QueueItem load(org.apache.zookeeper.ZooKeeper client) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
MerrittZKNodeInvalidorg.apache.zookeeper.KeeperExceptionInterruptedException
-
loadStatus
public void loadStatus(org.apache.zookeeper.ZooKeeper client, org.json.JSONObject js) throws MerrittZKNodeInvalid- Throws:
MerrittZKNodeInvalid
-
resolveStatus
public abstract IngestState resolveStatus(String s)
-
loadProperties
public void loadProperties(org.apache.zookeeper.ZooKeeper client) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException- Throws:
MerrittZKNodeInvalidorg.apache.zookeeper.KeeperExceptionInterruptedException
-
optStringProperty
public String optStringProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key) throws org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
stringProperty
public String stringProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException
- Throws:
MerrittZKNodeInvalidorg.apache.zookeeper.KeeperExceptionInterruptedException
-
jsonProperty
public org.json.JSONObject jsonProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException- Throws:
MerrittZKNodeInvalidorg.apache.zookeeper.KeeperExceptionInterruptedException
-
optJsonProperty
public org.json.JSONObject optJsonProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException- Throws:
MerrittZKNodeInvalidorg.apache.zookeeper.KeeperExceptionInterruptedException
-
intProperty
public int intProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException- Throws:
MerrittZKNodeInvalidorg.apache.zookeeper.KeeperExceptionInterruptedException
-
longProperty
public long longProperty(org.apache.zookeeper.ZooKeeper client, ZKKey key) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException- Throws:
MerrittZKNodeInvalidorg.apache.zookeeper.KeeperExceptionInterruptedException
-
setData
public void setData(org.apache.zookeeper.ZooKeeper client, ZKKey key, Object data) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
createData
public void createData(org.apache.zookeeper.ZooKeeper client, ZKKey key, Object data) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
createOrSetData
public void createOrSetData(org.apache.zookeeper.ZooKeeper client, ZKKey key, Object data) throws org.apache.zookeeper.KeeperException, InterruptedException- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
statusObject
public org.json.JSONObject statusObject(IngestState status)
-
setStatus
public void setStatus(org.apache.zookeeper.ZooKeeper client, IngestState status) throws org.apache.zookeeper.KeeperException, InterruptedException, MerrittZKNodeInvalid, MerrittStateError- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedExceptionMerrittZKNodeInvalidMerrittStateError
-
setStatus
public void setStatus(org.apache.zookeeper.ZooKeeper client, IngestState status, String message) throws org.apache.zookeeper.KeeperException, InterruptedException, MerrittZKNodeInvalid, MerrittStateError- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedExceptionMerrittZKNodeInvalidMerrittStateError
-
setStatusTrigger
public void setStatusTrigger(org.apache.zookeeper.ZooKeeper client) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException- Throws:
MerrittZKNodeInvalidorg.apache.zookeeper.KeeperExceptionInterruptedException
-
lock
public boolean lock(org.apache.zookeeper.ZooKeeper client) throws InterruptedException- Throws:
InterruptedException
-
unlock
public boolean unlock(org.apache.zookeeper.ZooKeeper client) throws InterruptedException, org.apache.zookeeper.KeeperException- Throws:
InterruptedExceptionorg.apache.zookeeper.KeeperException
-
delete
public abstract void delete(org.apache.zookeeper.ZooKeeper client) throws MerrittStateError, MerrittZKNodeInvalid, InterruptedException, org.apache.zookeeper.KeeperException- Throws:
MerrittStateErrorMerrittZKNodeInvalidInterruptedExceptionorg.apache.zookeeper.KeeperException
-
-