sanha commented on a change in pull request #1: [NEMO-26] Implement 
SourceLocationAwareSchedulingPolicy
URL: https://github.com/apache/incubator-nemo/pull/1#discussion_r172720282
 
 

 ##########
 File path: 
compiler/frontend/beam/src/main/java/edu/snu/nemo/compiler/frontend/beam/source/BeamBoundedSourceVertex.java
 ##########
 @@ -94,5 +98,18 @@ public String propertiesToJSON() {
       }
       return elements;
     }
+
+    @Override
+    public List<String> getLocations() throws Exception {
+      if (boundedSource instanceof 
HadoopInputFormatIO.HadoopInputFormatBoundedSource) {
+        final Field inputSplitField = 
boundedSource.getClass().getDeclaredField("inputSplit");
+        inputSplitField.setAccessible(true);
+        final InputSplit inputSplit = ((HadoopInputFormatIO.SerializableSplit) 
inputSplitField
+            .get(boundedSource)).getSplit();
+        return Arrays.asList(inputSplit.getLocations());
+      } else {
+        throw new UnsupportedOperationException();
 
 Review comment:
   `return Collections.emptyList();` ?
   (Because the default method return it.)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to