Github user ellisonanne commented on a diff in the pull request:
https://github.com/apache/incubator-pirk/pull/81#discussion_r76517354
--- Diff:
src/main/java/org/apache/pirk/querier/wideskies/encrypt/EncryptQuery.java ---
@@ -200,31 +181,29 @@ public void encrypt(int numThreads) throws
InterruptedException, PIRException
return selectorQueryVecMapping;
}
- private void populateEmbeddedSelectorMap()
+ private Map<Integer,String> computeEmbeddedSelectorMap() throws
PIRException
{
QuerySchema qSchema =
QuerySchemaRegistry.get(queryInfo.getQueryType());
+ String selectorName = qSchema.getSelectorName();
DataSchema dSchema =
DataSchemaRegistry.get(qSchema.getDataSchemaName());
- String type = dSchema.getElementType(qSchema.getSelectorName());
+ String type = dSchema.getElementType(selectorName);
+
+ Map<Integer,String> embedSelectorMap = new HashMap<>(selectors.size());
+
int sNum = 0;
for (String selector : selectors)
{
- String embeddedSelector = null;
- try
- {
- embeddedSelector = QueryUtils.getEmbeddedSelector(selector, type,
dSchema.getPartitionerForElement(qSchema.getSelectorName()));
- } catch (Exception e)
- {
- logger.info("Caught exception for selector = " + selector);
- e.printStackTrace();
- // TODO: Check: should continue?
- }
-
- embedSelectorMap.put(sNum, embeddedSelector);
- ++sNum;
+ String embeddedSelector = QueryUtils.getEmbeddedSelector(selector,
type, dSchema.getPartitionerForElement(selectorName));
+ embedSelectorMap.put(sNum++, embeddedSelector);
--- End diff --
Correct, but readability? ;)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---