-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: ntisseyre <[email protected]>
- Loading branch information
Showing
20 changed files
with
521 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
import java.util.List; | ||
import java.util.Map; | ||
import java.util.function.Predicate; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* @author Matthias Broecheler ([email protected]) | ||
|
@@ -50,23 +51,31 @@ public class VertexJobConverter extends AbstractScanJob { | |
|
||
protected final VertexScanJob job; | ||
|
||
protected final List<Object> vertexIdsToScan; | ||
|
||
protected VertexJobConverter(JanusGraph graph, VertexScanJob job) { | ||
this(graph, job, null); | ||
} | ||
|
||
protected VertexJobConverter(JanusGraph graph, VertexScanJob job, List<Object> vertexIdsToScan) { | ||
super(graph); | ||
Preconditions.checkArgument(job!=null); | ||
this.job = job; | ||
this.vertexIdsToScan = vertexIdsToScan; | ||
} | ||
|
||
protected VertexJobConverter(VertexJobConverter copy) { | ||
super(copy); | ||
this.job = copy.job.clone(); | ||
this.vertexIdsToScan = copy.vertexIdsToScan; | ||
} | ||
|
||
public static ScanJob convert(JanusGraph graph, VertexScanJob vertexJob) { | ||
return new VertexJobConverter(graph,vertexJob); | ||
public static ScanJob convert(JanusGraph graph, VertexScanJob vertexJob, List<Object> vertexIdsToScan) { | ||
return new VertexJobConverter(graph, vertexJob, vertexIdsToScan); | ||
} | ||
|
||
public static ScanJob convert(VertexScanJob vertexJob) { | ||
return new VertexJobConverter(null,vertexJob); | ||
return new VertexJobConverter(null, vertexJob, null); | ||
} | ||
|
||
@Override | ||
|
@@ -130,6 +139,18 @@ public List<SliceQuery> getQueries() { | |
} | ||
} | ||
|
||
@Override | ||
public List<StaticBuffer> getKeysToScan() { | ||
if (this.vertexIdsToScan == null) { | ||
return null; | ||
} else { | ||
return this.vertexIdsToScan | ||
.stream() | ||
.map(k -> idManager.getKey(k)) | ||
.collect(Collectors.toList()); | ||
} | ||
} | ||
|
||
@Override | ||
public Predicate<StaticBuffer> getKeyFilter() { | ||
return buffer -> !IDManager.VertexIDType.Invisible.is(getVertexId(buffer)); | ||
|
Oops, something went wrong.