Tabnine Logo
VertexProgram.getElementComputeKeys
Code IndexAdd Tabnine to your IDE (free)

How to use
getElementComputeKeys
method
in
org.apache.tinkerpop.gremlin.process.computer.VertexProgram

Best Java code snippets using org.apache.tinkerpop.gremlin.process.computer.VertexProgram.getElementComputeKeys (Showing top 7 results out of 315)

origin: thinkaurelius/titan

public FulgoraVertexMemory(int numVertices, final IDManager idManager, final VertexProgram<M> vertexProgram) {
  Preconditions.checkArgument(numVertices>=0 && vertexProgram!=null && idManager!=null);
  vertexStates = new NonBlockingHashMapLong<>(numVertices);
  partitionVertices = new NonBlockingHashMapLong<>(64);
  this.idManager = idManager;
  this.combiner = FulgoraUtil.getMessageCombiner(vertexProgram);
  this.elementKeyMap = getIdMap(vertexProgram.getElementComputeKeys());
  this.previousScopes = ImmutableMap.of();
}
origin: thinkaurelius/titan

@Override
public RecordWriter<NullWritable, VertexWritable> getRecordWriter(TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException {
  synchronized (this) {
    if (null == graph) {
      Configuration hadoopConf = taskAttemptContext.getConfiguration();
      ModifiableHadoopConfiguration mhc =
          ModifiableHadoopConfiguration.of(TitanHadoopConfiguration.MAPRED_NS, hadoopConf);
      graph = (StandardTitanGraph) TitanFactory.open(mhc.getTitanGraphConf());
    }
  }
  // Special case for a TP3 vertex program: persist only those properties whose keys are
  // returned by VertexProgram.getComputeKeys()
  if (null == persistableKeys) {
    try {
      persistableKeys = VertexProgram.createVertexProgram(graph,
          ConfUtil.makeApacheConfiguration(taskAttemptContext.getConfiguration())).getElementComputeKeys();
      log.debug("Set persistableKeys={}", Joiner.on(",").join(persistableKeys));
    } catch (Exception e) {
      log.debug("Unable to detect or instantiate vertex program", e);
      persistableKeys = ImmutableSet.of();
    }
  }
  StandardTitanTx tx = transactions.computeIfAbsent(taskAttemptContext.getTaskAttemptID(),
      id -> (StandardTitanTx)graph.newTransaction());
  return new TitanH1RecordWriter(taskAttemptContext, tx, persistableKeys);
}
origin: thinkaurelius/titan

if (persistMode == Persist.NOTHING && resultGraphMode == ResultGraph.NEW) {
  resultgraph = EmptyGraph.instance();
} else if (persistMode != Persist.NOTHING && vertexProgram != null && !vertexProgram.getElementComputeKeys().isEmpty()) {
    for (String key : vertexProgram.getElementComputeKeys()) {
      if (!mgmt.containsPropertyKey(key))
        log.warn("Property key [{}] is not part of the schema and will be created. It is advised to initialize all keys.", key);
    AtomicInteger failures = new AtomicInteger(0);
    try (WorkerPool workers = new WorkerPool(numThreads)) {
      List<Map.Entry<Long, Map<String, Object>>> subset = new ArrayList<>(writeBatchSize / vertexProgram.getElementComputeKeys().size());
      int currentSize = 0;
      for (Map.Entry<Long, Map<String, Object>> entry : mutatedProperties.entrySet()) {
origin: com.thinkaurelius.titan/titan-core

public FulgoraVertexMemory(int numVertices, final IDManager idManager, final VertexProgram<M> vertexProgram) {
  Preconditions.checkArgument(numVertices>=0 && vertexProgram!=null && idManager!=null);
  vertexStates = new NonBlockingHashMapLong<>(numVertices);
  partitionVertices = new NonBlockingHashMapLong<>(64);
  this.idManager = idManager;
  this.combiner = FulgoraUtil.getMessageCombiner(vertexProgram);
  this.elementKeyMap = getIdMap(vertexProgram.getElementComputeKeys());
  this.previousScopes = ImmutableMap.of();
}
origin: com.thinkaurelius.titan/titan-hadoop

@Override
public RecordWriter<NullWritable, VertexWritable> getRecordWriter(TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException {
  synchronized (this) {
    if (null == graph) {
      Configuration hadoopConf = taskAttemptContext.getConfiguration();
      ModifiableHadoopConfiguration mhc =
          ModifiableHadoopConfiguration.of(TitanHadoopConfiguration.MAPRED_NS, hadoopConf);
      graph = (StandardTitanGraph) TitanFactory.open(mhc.getTitanGraphConf());
    }
  }
  // Special case for a TP3 vertex program: persist only those properties whose keys are
  // returned by VertexProgram.getComputeKeys()
  if (null == persistableKeys) {
    try {
      persistableKeys = VertexProgram.createVertexProgram(graph,
          ConfUtil.makeApacheConfiguration(taskAttemptContext.getConfiguration())).getElementComputeKeys();
      log.debug("Set persistableKeys={}", Joiner.on(",").join(persistableKeys));
    } catch (Exception e) {
      log.debug("Unable to detect or instantiate vertex program", e);
      persistableKeys = ImmutableSet.of();
    }
  }
  StandardTitanTx tx = transactions.computeIfAbsent(taskAttemptContext.getTaskAttemptID(),
      id -> (StandardTitanTx)graph.newTransaction());
  return new TitanH1RecordWriter(taskAttemptContext, tx, persistableKeys);
}
origin: com.thinkaurelius.titan/titan-hadoop-1

@Override
public RecordWriter<NullWritable, VertexWritable> getRecordWriter(TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException {
  synchronized (this) {
    if (null == graph) {
      Configuration hadoopConf = taskAttemptContext.getConfiguration();
      ModifiableHadoopConfiguration mhc =
          ModifiableHadoopConfiguration.of(TitanHadoopConfiguration.MAPRED_NS, hadoopConf);
      graph = (StandardTitanGraph) TitanFactory.open(mhc.getTitanGraphConf());
    }
  }
  // Special case for a TP3 vertex program: persist only those properties whose keys are
  // returned by VertexProgram.getComputeKeys()
  if (null == persistableKeys) {
    try {
      persistableKeys = VertexProgram.createVertexProgram(graph,
          ConfUtil.makeApacheConfiguration(taskAttemptContext.getConfiguration())).getElementComputeKeys();
      log.debug("Set persistableKeys={}", Joiner.on(",").join(persistableKeys));
    } catch (Exception e) {
      log.debug("Unable to detect or instantiate vertex program", e);
      persistableKeys = ImmutableSet.of();
    }
  }
  StandardTitanTx tx = transactions.computeIfAbsent(taskAttemptContext.getTaskAttemptID(),
      id -> (StandardTitanTx)graph.newTransaction());
  return new TitanH1RecordWriter(taskAttemptContext, tx, persistableKeys);
}
origin: com.thinkaurelius.titan/titan-core

if (persistMode == Persist.NOTHING && resultGraphMode == ResultGraph.NEW) {
  resultgraph = EmptyGraph.instance();
} else if (persistMode != Persist.NOTHING && vertexProgram != null && !vertexProgram.getElementComputeKeys().isEmpty()) {
    for (String key : vertexProgram.getElementComputeKeys()) {
      if (!mgmt.containsPropertyKey(key))
        log.warn("Property key [{}] is not part of the schema and will be created. It is advised to initialize all keys.", key);
    AtomicInteger failures = new AtomicInteger(0);
    try (WorkerPool workers = new WorkerPool(numThreads)) {
      List<Map.Entry<Long, Map<String, Object>>> subset = new ArrayList<>(writeBatchSize / vertexProgram.getElementComputeKeys().size());
      int currentSize = 0;
      for (Map.Entry<Long, Map<String, Object>> entry : mutatedProperties.entrySet()) {
org.apache.tinkerpop.gremlin.process.computerVertexProgramgetElementComputeKeys

Popular methods of VertexProgram

  • getMemoryComputeKeys
    The Memory keys that will be used during the computation. These are the only keys that can be read o
  • workerIterationEnd
    This method is called at the end of each iteration of each "computational chunk." The set of vertice
  • workerIterationStart
    This method is called at the start of each iteration of each "computational chunk." The set of verti
  • createVertexProgram
    A helper method to construct a VertexProgram given the content of the supplied configuration. The cl
  • execute
    This method denotes the main body of the computation and is executed on each vertex in the graph. Th
  • getMessageCombiner
    Combine the messages in route to a particular vertex. Useful to reduce the amount of data transmitte
  • getVertexComputeKeys
    The org.apache.tinkerpop.gremlin.structure.Element properties that will be mutated during the comput
  • setup
    The method is called at the beginning of the computation. The method is global to the GraphComputer
  • terminate
    The method is called at the end of each iteration to determine if the computation is complete. The m
  • getMapReducers
    The set of MapReduce jobs that are associated with the VertexProgram. This is not necessarily the ex
  • storeState
    When it is necessary to store the state of the VertexProgram, this method is called. This is typical
  • clone
    When multiple workers on a single machine need VertexProgram instances, it is possible to use clone.
  • storeState,
  • clone,
  • getMessageScopes,
  • loadState,
  • getFeatures,
  • getPreferredPersist,
  • getPreferredResultGraph,
  • getTraverserRequirements

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now