Skip to content

Commit b5e1625

Browse files
committed
Parse docid rather than file path.
1 parent 1cfa50d commit b5e1625

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/main/java/org/dataone/indexer/queue/IndexQueueMessageParser.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ public class IndexQueueMessageParser {
2121
private final static String HEADER_ID = "id";
2222
//The header name in the message to store the index type
2323
private final static String HEADER_INDEX_TYPE = "index_type";
24-
//The header name in the message to store the path of the object
25-
private final static String HEADER_PATH = "path";
24+
//The header name in the message to store the docid of the object
25+
private final static String HEADER_DOCID = "doc_id";
2626
private Identifier identifier = null;
2727
private String indexType = null;
2828
private int priority = 1;
29-
private String objectPath;
29+
private String docId = null;
3030

3131
private static Log logger = LogFactory.getLog(IndexQueueMessageParser.class);
3232

@@ -72,12 +72,12 @@ public void parse(AMQP.BasicProperties properties, byte[] body) throws InvalidRe
7272
"The index type cannot be null or blank in the index queue message for " + pid);
7373
}
7474
logger.debug("The index type in the message is " + indexType + " for " + pid);
75-
Object pathObject = headers.get(HEADER_PATH);
76-
if (pathObject != null) {
77-
objectPath = ((LongString)pathObject).toString();
75+
Object docIdObject = headers.get(HEADER_DOCID);
76+
if (docIdObject != null) {
77+
docId = ((LongString)docIdObject).toString();
7878
}
7979
logger.debug(
80-
"The file path of the object which will be indexed in the message is " + objectPath +
80+
"The docId of the object which will be indexed in the message is " + docId +
8181
" for " + pid);
8282

8383
try {
@@ -118,13 +118,13 @@ public int getPriority() {
118118
}
119119

120120
/**
121-
* Get the file path of the object, which will be indexed,
121+
* Get the docId of the object, which will be indexed,
122122
* after calling the parse method to parse the index queue message.
123-
* @return the file path of the object. It can be null or blank, which
124-
* means we don't have the object in the system.
123+
* @return the docId of the object. DocId is an iternal id of Metacat, which is a file name in
124+
* the system. It can be null or blank, which means we don't have the object in the system.
125125
*/
126-
public String getObjectPath() {
127-
return objectPath;
126+
public String getDocId() {
127+
return docId;
128128
}
129129

130130
}

0 commit comments

Comments
 (0)