Commits

Anonymous committed 92a6aef

variable Inventory Node Name (ZK)

Comments (0)

Files changed (5)

ingest-src/src/main/java/org/cdlib/mrt/ingest/BatchState.java

     private String batchStatusMessage = null;
     private String queueConnectionString = null;
     private String queueNode = null;
+    private String inventoryNode = null;
     private Map<String, JobState> jobStates = new HashMap<String, JobState>();
     private static Map<String, BatchState> batchStates = new HashMap<String, BatchState>();
     private static Map<String, Integer> batchReadiness = new HashMap<String, Integer>();
         return this.queueNode;
     }
 
+    public String grabTargetInventoryNode()
+    {
+        return this.inventoryNode;
+    }
+
     /**
      * Set queue target node
      * @param String target queue node
         this.queueNode = queueNode;
     }
 
+    /**
+     * Set inventory target node
+     * @param String target inventory node
+     */
+    public void setTargetInventoryNode(String inventoryNode) {
+        this.inventoryNode = inventoryNode;
+    }
+
     public ProfileState grabBatchProfile()
     {
         return batchProfile;

ingest-src/src/main/java/org/cdlib/mrt/ingest/IngestManager.java

                     if (handler.getClass() == org.cdlib.mrt.ingest.handlers.HandlerInventoryQueue.class) {
 	    		if ( ! batchState.getBatchID().getValue().equalsIgnoreCase(ProfileUtil.DEFAULT_BATCH_ID)) {
 			    jobState.setMisc(batchState.grabTargetQueue());
+			    jobState.setExtra(batchState.grabTargetInventoryNode());
 			} else {
 			    // not a batch
 			    jobState.setMisc(getProps(ingestRequest, "queue.txt").getProperty("QueueService"));
+			    jobState.setExtra(getProps(ingestRequest, "queue.txt").getProperty("InventoryName"));
 			}
                     }
 

ingest-src/src/main/java/org/cdlib/mrt/ingest/JobState.java

 	private String jobStatusMessage = null;
 	private String objectType = null;
 	private String misc = null;
+	private String extra = null;
 	private String note = null;
 	private String queuePriority = null;
 	private String metacatStatus = null;		// only if dataONE handler active
     }
 
     /**
+     * Set extra data
+     * @param String extra
+     */
+    public void setExtra(String extra) {
+        this.extra = extra;
+    }
+
+    /**
+     * Get extra data
+     * @return String extra
+     */
+    public String grabExtra() {
+        return extra;
+    }
+
+    /**
      * Set DataCite metadata
      * @param String DataCite metadata
      */

ingest-src/src/main/java/org/cdlib/mrt/ingest/QueueManager.java

     private Properties queueProperties = null;
     private String queueConnectionString = null;
     private String queueNode = null;
+    private String inventoryNode = "/inv";	// default
     private ArrayList<String> m_admin = new ArrayList<String>(20);
 
     private boolean debugDump = false;
             String matchIngest = "ingestServicePath";
             String matchQueueService = "QueueService";
             String matchQueueNode = "QueueName";
+            String matchInventoryNode = "InventoryName";
             String matchAdmin = "admin";
             String defaultIDKey = "IDDefault";
 	    Integer storageID = null;
             while( e.hasMoreElements() ) {
                 key = (String) e.nextElement();
                 value = ingestProperties.getProperty(key);
-                if (key.equals(matchQueueService)) {
-		    this.queueConnectionString = value;
-                }
-                if (key.equals(matchQueueNode)) {
-		    this.queueNode = value;
-                }
+                if (key.equals(matchQueueService)) this.queueConnectionString = value;
+                if (key.equals(matchQueueNode) )this.queueNode = value;
+                if (key.equals(matchInventoryNode)) this.inventoryNode = value;
 
                 // admin notification
                 if (key.startsWith(matchAdmin)) {
 	    batchState.clear();
 	    batchState.setTargetQueue(queueConnectionString);
 	    batchState.setTargetQueueNode(queueNode);
+	    batchState.setTargetInventoryNode(inventoryNode);
 	    batchState.setUserAgent(ingestRequest.getJob().grabUserAgent());
 	    batchState.setSubmissionDate(new DateState(DateUtil.getCurrentDate()));
 	    batchState.setBatchStatus(BatchStatusEnum.QUEUED);

ingest-src/src/main/java/org/cdlib/mrt/ingest/handlers/HandlerInventoryQueue.java

 
 	    // MySQL (full schema)
             distributedQueue = 
-                new DistributedQueue(zooKeeper, "/distrib.vat01.1inv", null);
+                new DistributedQueue(zooKeeper, jobState.grabExtra(), null);
 	    prop = getInventoryProps(profileState, jobState);
 	    System.out.println("HandlerInventoryQueue submitting properties [MySQL]: " + prop.toString());
             submit(ZooCodeUtil.encodeItem(prop));
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.