Package org.cdlib.mrt.zk
Class Job
java.lang.Object
org.cdlib.mrt.zk.QueueItem
org.cdlib.mrt.zk.Job
Class to manage a Merritt Ingest Job in the Job Queue.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cdlib.mrt.zk.QueueItem
QueueItem.BatchJobStates, QueueItem.ZkPaths, QueueItem.ZkPrefixes
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Job
acquireJob
(org.apache.zookeeper.ZooKeeper client, IngestState state) bid()
static Job
createJob
(org.apache.zookeeper.ZooKeeper client, String bid, int priority, org.json.JSONObject configuration) static Job
createJob
(org.apache.zookeeper.ZooKeeper client, String bid, int priority, org.json.JSONObject configuration, org.json.JSONObject identifiers) static Job
createJob
(org.apache.zookeeper.ZooKeeper client, String bid, int priority, org.json.JSONObject configuration, org.json.JSONObject identifiers, org.json.JSONObject metadata) static Job
static org.json.JSONObject
createJobConfiguration
(String profile, String submitter, String payloadUrl, String payloadType, String responseType) static org.json.JSONObject
createJobIdentifiers
(String primary, String local) static org.json.JSONObject
createJobMetadata
(String who, String what, String when, String where) void
delete
(org.apache.zookeeper.ZooKeeper client) dir()
ercWhat()
ercWhen()
ercWhere()
ercWho()
static void
initNodes
(org.apache.zookeeper.ZooKeeper client) static IngestState
jid()
listJobs
(org.apache.zookeeper.ZooKeeper client, IngestState state) void
loadProperties
(org.apache.zookeeper.ZooKeeper client, boolean setStatus) void
loadStatus
(org.apache.zookeeper.ZooKeeper client, org.json.JSONObject js) localId()
prefix()
static String
int
priority()
int
void
setBatchStatePath
(org.apache.zookeeper.ZooKeeper client) void
setIdentifiers
(org.apache.zookeeper.ZooKeeper client, org.json.JSONObject identifiers) void
setInventory
(org.apache.zookeeper.ZooKeeper client, String manifest_url, String mode) void
setJobStatePath
(org.apache.zookeeper.ZooKeeper client) void
setMetadata
(org.apache.zookeeper.ZooKeeper client, org.json.JSONObject metadata) void
setSpaceNeeded
(org.apache.zookeeper.ZooKeeper client, long spaceNeeded) void
setStatusTrigger
(org.apache.zookeeper.ZooKeeper client) void
setStatusWithPriority
(org.apache.zookeeper.ZooKeeper client, IngestState status, int priority) void
setStatusWithRetry
(org.apache.zookeeper.ZooKeeper client, IngestState status) long
states()
org.json.JSONObject
statusObject
(org.json.JSONObject statj, IngestState status) Methods inherited from class org.cdlib.mrt.zk.QueueItem
createData, createOrSetData, data, id, intProperty, jsonDataProperty, jsonIntProperty, jsonLongProperty, jsonProperty, jsonStringProperty, load, load, lock, longProperty, makePath, optJsonProperty, optStringProperty, path, setData, setStatus, setStatus, status, stringProperty, unlock
-
Field Details
-
PRIORITY
public static int PRIORITY
-
-
Constructor Details
-
Job
-
Job
-
Job
-
-
Method Details
-
bid
-
jobStatePath
-
batchStatePath
-
retryCount
public int retryCount() -
priority
public int priority() -
spaceNeeded
public long spaceNeeded() -
dir
-
prefix
-
prefixPath
-
initStatus
-
resolveStatus
- Specified by:
resolveStatus
in classQueueItem
-
loadProperties
public void loadProperties(org.apache.zookeeper.ZooKeeper client, boolean setStatus) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException - Overrides:
loadProperties
in classQueueItem
- Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
-
states
-
createJobMetadata
-
ercWho
-
ercWhat
-
ercWhen
-
ercWhere
-
createJobIdentifiers
-
-
localId
-
createJobConfiguration
-
profileName
-
submitter
-
payloadUrl
-
payloadType
-
responseType
-
jid
-
createJob
public static Job createJob(org.apache.zookeeper.ZooKeeper client, String bid, org.json.JSONObject configuration) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException, MerrittStateError - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
MerrittStateError
-
createJob
public static Job createJob(org.apache.zookeeper.ZooKeeper client, String bid, int priority, org.json.JSONObject configuration) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException, MerrittStateError - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
MerrittStateError
-
createJob
public static Job createJob(org.apache.zookeeper.ZooKeeper client, String bid, int priority, org.json.JSONObject configuration, org.json.JSONObject identifiers) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException, MerrittStateError - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
MerrittStateError
-
createJob
public static Job createJob(org.apache.zookeeper.ZooKeeper client, String bid, int priority, org.json.JSONObject configuration, org.json.JSONObject identifiers, org.json.JSONObject metadata) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException, MerrittStateError - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
MerrittStateError
-
statusObject
- Overrides:
statusObject
in classQueueItem
-
loadStatus
public void loadStatus(org.apache.zookeeper.ZooKeeper client, org.json.JSONObject js) throws MerrittZKNodeInvalid - Overrides:
loadStatus
in classQueueItem
- Throws:
MerrittZKNodeInvalid
-
setSpaceNeeded
public void setSpaceNeeded(org.apache.zookeeper.ZooKeeper client, long spaceNeeded) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
-
setIdentifiers
public void setIdentifiers(org.apache.zookeeper.ZooKeeper client, org.json.JSONObject identifiers) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
-
setMetadata
public void setMetadata(org.apache.zookeeper.ZooKeeper client, org.json.JSONObject metadata) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
-
setInventory
public void setInventory(org.apache.zookeeper.ZooKeeper client, String manifest_url, String mode) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
-
inventoryManifestUrl
-
inventoryMode
-
setStatusWithRetry
public void setStatusWithRetry(org.apache.zookeeper.ZooKeeper client, IngestState status) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException, MerrittStateError - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
MerrittStateError
-
setStatusWithPriority
public void setStatusWithPriority(org.apache.zookeeper.ZooKeeper client, IngestState status, int priority) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException, MerrittStateError - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
MerrittStateError
-
setStatusTrigger
public void setStatusTrigger(org.apache.zookeeper.ZooKeeper client) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException - Overrides:
setStatusTrigger
in classQueueItem
- Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
-
batchStateSubpath
-
setBatchStatePath
public void setBatchStatePath(org.apache.zookeeper.ZooKeeper client) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
-
setJobStatePath
public void setJobStatePath(org.apache.zookeeper.ZooKeeper client) throws MerrittZKNodeInvalid, InterruptedException, org.apache.zookeeper.KeeperException - Throws:
MerrittZKNodeInvalid
InterruptedException
org.apache.zookeeper.KeeperException
-
delete
public void delete(org.apache.zookeeper.ZooKeeper client) throws MerrittStateError, MerrittZKNodeInvalid, InterruptedException, org.apache.zookeeper.KeeperException - Specified by:
delete
in classQueueItem
- Throws:
MerrittStateError
MerrittZKNodeInvalid
InterruptedException
org.apache.zookeeper.KeeperException
-
acquireJob
public static Job acquireJob(org.apache.zookeeper.ZooKeeper client, IngestState state) throws MerrittZKNodeInvalid, org.apache.zookeeper.KeeperException, InterruptedException - Throws:
MerrittZKNodeInvalid
org.apache.zookeeper.KeeperException
InterruptedException
-
initNodes
public static void initNodes(org.apache.zookeeper.ZooKeeper client) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
listJobs
public static List<Job> listJobs(org.apache.zookeeper.ZooKeeper client, IngestState state) throws org.apache.zookeeper.KeeperException, InterruptedException, MerrittZKNodeInvalid - Throws:
org.apache.zookeeper.KeeperException
InterruptedException
MerrittZKNodeInvalid
-