Remove copy/paste metadataStorage from ES, following DS-421

Stumbled upon strange code, that has a note in DS-421.
Which says metadata storage in usage-event stats engine was inadvertent,
so ES has no need to include this. Note: I haven't touched SolrLogger
This commit is contained in:
Peter Dietz
2012-08-23 00:03:01 -04:00
parent 391fbb47b4
commit 9282c2a6c5

View File

@@ -57,8 +57,6 @@ public class ElasticSearchLogger {
private static LookupService locationService;
private static Map<String, String> metadataStorageInfo;
public static String clusterName = "dspacestatslogging";
public static String indexName = "dspaceindex";
public static String indexType = "stats";
@@ -117,18 +115,6 @@ public class ElasticSearchLogger {
}
log.info("useProxies=" + useProxies);
metadataStorageInfo = new HashMap<String, String>();
int count = 1;
String metadataVal;
while ((metadataVal = ConfigurationManager.getProperty("solr-statistics", "metadata.item." + count)) != null) {
String storeVal = metadataVal.split(":")[0];
String metadataField = metadataVal.split(":")[1];
metadataStorageInfo.put(storeVal, metadataField);
log.info("solr-statistics.metadata.item." + count + "=" + metadataVal);
count++;
}
// Configurable values for all elasticsearch connection constants
clusterName = getConfigurationStringWithFallBack("statistics.elasticsearch.clusterName", clusterName);
@@ -362,25 +348,6 @@ public class ElasticSearchLogger {
}
}
if (dspaceObject instanceof Item) {
Item item = (Item) dspaceObject;
// Store the metadata
for (Object storedField : metadataStorageInfo.keySet()) {
String dcField = metadataStorageInfo
.get(storedField);
DCValue[] vals = item.getMetadata(dcField.split("\\.")[0],
dcField.split("\\.")[1], dcField.split("\\.")[2],
Item.ANY);
for (DCValue val1 : vals) {
String val = val1.value;
docBuilder.field(String.valueOf(storedField), val);
docBuilder.field(storedField + "_search", val
.toLowerCase());
}
}
}
if (dspaceObject instanceof Bitstream) {
Bitstream bit = (Bitstream) dspaceObject;
Bundle[] bundles = bit.getBundles();