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

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

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

origin: thinkaurelius/titan

public FulgoraMemory(final VertexProgram<?> vertexProgram, final Set<MapReduce> mapReducers) {
  this.currentMap = new ConcurrentHashMap<>();
  this.previousMap = new ConcurrentHashMap<>();
  if (null != vertexProgram) {
    for (final String key : vertexProgram.getMemoryComputeKeys()) {
      MemoryHelper.validateKey(key);
      this.memoryKeys.add(key);
    }
  }
  for (final MapReduce mapReduce : mapReducers) {
    this.memoryKeys.add(mapReduce.getMemoryKey());
  }
}
origin: JanusGraph/janusgraph

public FulgoraMemory(final VertexProgram<?> vertexProgram, final Set<MapReduce> mapReducers) {
  this.currentMap = new ConcurrentHashMap<>();
  this.previousMap = new ConcurrentHashMap<>();
  if (null != vertexProgram) {
    for (final MemoryComputeKey key : vertexProgram.getMemoryComputeKeys()) {
      this.memoryKeys.put(key.getKey(), key);
    }
  }
  for (final MapReduce mapReduce : mapReducers) {
    this.memoryKeys.put(mapReduce.getMemoryKey(), MemoryComputeKey.of(mapReduce.getMemoryKey(), Operator.assign, false, false));
  }
}
origin: apache/tinkerpop

public void addVertexProgramMemoryComputeKeys(final VertexProgram<?> vertexProgram) {
  vertexProgram.getMemoryComputeKeys().forEach(key -> this.memoryComputeKeys.put(key.getKey(), key));
}
origin: apache/tinkerpop

public static void validateProgramOnComputer(final GraphComputer computer, final VertexProgram vertexProgram) {
  if (vertexProgram.getMemoryComputeKeys().contains(null))
    throw Memory.Exceptions.memoryKeyCanNotBeNull();
  if (vertexProgram.getMemoryComputeKeys().contains(""))
    throw Memory.Exceptions.memoryKeyCanNotBeEmpty();
  final GraphComputer.Features graphComputerFeatures = computer.features();
  final VertexProgram.Features vertexProgramFeatures = vertexProgram.getFeatures();
  for (final Method method : VertexProgram.Features.class.getMethods()) {
    if (method.getName().startsWith("requires")) {
      final boolean supports;
      final boolean requires;
      try {
        supports = (boolean) GraphComputer.Features.class.getMethod(method.getName().replace("requires", "supports")).invoke(graphComputerFeatures);
        requires = (boolean) method.invoke(vertexProgramFeatures);
      } catch (final Exception e) {
        throw new IllegalStateException("A reflection exception has occurred: " + e.getMessage(), e);
      }
      if (requires && !supports)
        throw new IllegalStateException("The vertex program can not be executed on the graph computer: " + method.getName());
    }
  }
}
origin: apache/tinkerpop

public TinkerMemory(final VertexProgram<?> vertexProgram, final Set<MapReduce> mapReducers) {
  this.currentMap = new ConcurrentHashMap<>();
  this.previousMap = new ConcurrentHashMap<>();
  if (null != vertexProgram) {
    for (final MemoryComputeKey memoryComputeKey : vertexProgram.getMemoryComputeKeys()) {
      this.memoryKeys.put(memoryComputeKey.getKey(), memoryComputeKey);
    }
  }
  for (final MapReduce mapReduce : mapReducers) {
    this.memoryKeys.put(mapReduce.getMemoryKey(), MemoryComputeKey.of(mapReduce.getMemoryKey(), Operator.assign, false, false));
  }
}
origin: apache/tinkerpop

public SparkMemory(final VertexProgram<?> vertexProgram, final Set<MapReduce> mapReducers, final JavaSparkContext sparkContext) {
  if (null != vertexProgram) {
    for (final MemoryComputeKey key : vertexProgram.getMemoryComputeKeys()) {
      this.memoryComputeKeys.put(key.getKey(), key);
    }
  }
  for (final MapReduce mapReduce : mapReducers) {
    this.memoryComputeKeys.put(mapReduce.getMemoryKey(), MemoryComputeKey.of(mapReduce.getMemoryKey(), Operator.assign, false, false));
  }
  for (final MemoryComputeKey memoryComputeKey : this.memoryComputeKeys.values()) {
    this.sparkMemory.put(
        memoryComputeKey.getKey(),
        sparkContext.accumulator(ObjectWritable.empty(), memoryComputeKey.getKey(), new MemoryAccumulator<>(memoryComputeKey)));
  }
  this.broadcast = sparkContext.broadcast(Collections.emptyMap());
}
origin: org.apache.tinkerpop/gremlin-core

public void addVertexProgramMemoryComputeKeys(final VertexProgram<?> vertexProgram) {
  vertexProgram.getMemoryComputeKeys().forEach(key -> this.memoryComputeKeys.put(key.getKey(), key));
}
origin: com.thinkaurelius.titan/titan-core

public FulgoraMemory(final VertexProgram<?> vertexProgram, final Set<MapReduce> mapReducers) {
  this.currentMap = new ConcurrentHashMap<>();
  this.previousMap = new ConcurrentHashMap<>();
  if (null != vertexProgram) {
    for (final String key : vertexProgram.getMemoryComputeKeys()) {
      MemoryHelper.validateKey(key);
      this.memoryKeys.add(key);
    }
  }
  for (final MapReduce mapReduce : mapReducers) {
    this.memoryKeys.add(mapReduce.getMemoryKey());
  }
}
origin: com.puresoltechnologies.ductiledb/ductiledb-tinkerpop

public DuctileMemory(VertexProgram<M> vertexProgram, Set<MapReduce<?, ?, ?, ?, R>> mapReducers) {
if (null != vertexProgram) {
  for (String key : vertexProgram.getMemoryComputeKeys()) {
  MemoryHelper.validateKey(key);
  memoryKeys.add(key);
  }
}
for (MapReduce<?, ?, ?, ?, R> mapReduce : mapReducers) {
  memoryKeys.add(mapReduce.getMemoryKey());
}
}
origin: org.apache.tinkerpop/gremlin-core

public static void validateProgramOnComputer(final GraphComputer computer, final VertexProgram vertexProgram) {
  if (vertexProgram.getMemoryComputeKeys().contains(null))
    throw Memory.Exceptions.memoryKeyCanNotBeNull();
  if (vertexProgram.getMemoryComputeKeys().contains(""))
    throw Memory.Exceptions.memoryKeyCanNotBeEmpty();
  final GraphComputer.Features graphComputerFeatures = computer.features();
  final VertexProgram.Features vertexProgramFeatures = vertexProgram.getFeatures();
  for (final Method method : VertexProgram.Features.class.getMethods()) {
    if (method.getName().startsWith("requires")) {
      final boolean supports;
      final boolean requires;
      try {
        supports = (boolean) GraphComputer.Features.class.getMethod(method.getName().replace("requires", "supports")).invoke(graphComputerFeatures);
        requires = (boolean) method.invoke(vertexProgramFeatures);
      } catch (final Exception e) {
        throw new IllegalStateException("A reflection exception has occurred: " + e.getMessage(), e);
      }
      if (requires && !supports)
        throw new IllegalStateException("The vertex program can not be executed on the graph computer: " + method.getName());
    }
  }
}
origin: io.shiftleft/tinkergraph-gremlin

public TinkerMemory(final VertexProgram<?> vertexProgram, final Set<MapReduce> mapReducers) {
  this.currentMap = new ConcurrentHashMap<>();
  this.previousMap = new ConcurrentHashMap<>();
  if (null != vertexProgram) {
    for (final MemoryComputeKey memoryComputeKey : vertexProgram.getMemoryComputeKeys()) {
      this.memoryKeys.put(memoryComputeKey.getKey(), memoryComputeKey);
    }
  }
  for (final MapReduce mapReduce : mapReducers) {
    this.memoryKeys.put(mapReduce.getMemoryKey(), MemoryComputeKey.of(mapReduce.getMemoryKey(), Operator.assign, false, false));
  }
}
origin: org.apache.tinkerpop/tinkergraph-gremlin

public TinkerMemory(final VertexProgram<?> vertexProgram, final Set<MapReduce> mapReducers) {
  this.currentMap = new ConcurrentHashMap<>();
  this.previousMap = new ConcurrentHashMap<>();
  if (null != vertexProgram) {
    for (final MemoryComputeKey memoryComputeKey : vertexProgram.getMemoryComputeKeys()) {
      this.memoryKeys.put(memoryComputeKey.getKey(), memoryComputeKey);
    }
  }
  for (final MapReduce mapReduce : mapReducers) {
    this.memoryKeys.put(mapReduce.getMemoryKey(), MemoryComputeKey.of(mapReduce.getMemoryKey(), Operator.assign, false, false));
  }
}
origin: org.apache.tinkerpop/spark-gremlin

public SparkMemory(final VertexProgram<?> vertexProgram, final Set<MapReduce> mapReducers, final JavaSparkContext sparkContext) {
  if (null != vertexProgram) {
    for (final MemoryComputeKey key : vertexProgram.getMemoryComputeKeys()) {
      this.memoryComputeKeys.put(key.getKey(), key);
    }
  }
  for (final MapReduce mapReduce : mapReducers) {
    this.memoryComputeKeys.put(mapReduce.getMemoryKey(), MemoryComputeKey.of(mapReduce.getMemoryKey(), Operator.assign, false, false));
  }
  for (final MemoryComputeKey memoryComputeKey : this.memoryComputeKeys.values()) {
    this.sparkMemory.put(
        memoryComputeKey.getKey(),
        sparkContext.accumulator(ObjectWritable.empty(), memoryComputeKey.getKey(), new MemoryAccumulator<>(memoryComputeKey)));
  }
  this.broadcast = sparkContext.broadcast(Collections.emptyMap());
}
origin: ai.grakn/grakn-kb

public GraknSparkMemory(final VertexProgram<?> vertexProgram,
            final Set<MapReduce> mapReducers,
            final JavaSparkContext sparkContext) {
  if (null != vertexProgram) {
    for (final MemoryComputeKey key : vertexProgram.getMemoryComputeKeys()) {
      this.memoryComputeKeys.put(key.getKey(), key);
    }
  }
  for (final MapReduce mapReduce : mapReducers) {
    this.memoryComputeKeys.put(
        mapReduce.getMemoryKey(),
        MemoryComputeKey.of(mapReduce.getMemoryKey(), Operator.assign, false, false));
  }
  for (final MemoryComputeKey memoryComputeKey : this.memoryComputeKeys.values()) {
    this.sparkMemory.put(
        memoryComputeKey.getKey(),
        sparkContext.accumulator(ObjectWritable.empty(), memoryComputeKey.getKey(),
            new MemoryAccumulator<>(memoryComputeKey)));
  }
  this.broadcast = sparkContext.broadcast(Collections.emptyMap());
}
org.apache.tinkerpop.gremlin.process.computerVertexProgramgetMemoryComputeKeys

Javadoc

The Memory keys that will be used during the computation. These are the only keys that can be read or written throughout the life of the GraphComputer. The default is an empty set.

Popular methods of VertexProgram

  • 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.
  • getElementComputeKeys
  • clone,
  • getElementComputeKeys,
  • getMessageScopes,
  • loadState,
  • getFeatures,
  • getPreferredPersist,
  • getPreferredResultGraph,
  • getTraverserRequirements

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JButton (javax.swing)
  • JPanel (javax.swing)
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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