/** * Gets the variables of the {@link Graph} as a {@code Map}. */ public default Map<String, Object> asMap() { final Map<String, Object> map = keys().stream() .map(key -> Pair.with(key, get(key).get())) .collect(Collectors.toMap(Pair::getValue0, Pair::getValue1)); return Collections.unmodifiableMap(map); }
public static String graphVariablesString(final Graph.Variables variables) { return "variables" + L_BRACKET + "size:" + variables.keys().size() + R_BRACKET; }
@Watched protected void clearVariables() { Variables variables = this.variables(); variables.keys().forEach(key -> variables.remove(key)); }
public void setTinkerpopGraph(org.apache.tinkerpop.gremlin.structure.Graph tGraph) { this.tGraph = tGraph; LOGGER.debug("** Variables of the graph **"); try { for (String key : tGraph.variables().keys()) { LOGGER.info("key = " + key); } } catch (Exception ex) { LOGGER.error("Impossible to show graph variables. Cause: " + ex.toString()); } LOGGER.debug("****************************"); LOGGER.debug("** configuration **"); Configuration config = tGraph.configuration(); for (Iterator<String> c = config.getKeys(); c.hasNext();) { String key = c.next(); LOGGER.debug("{} {}", key, config.getString(key)); } LOGGER.debug("****************************"); }
public static String graphVariablesString(final Graph.Variables variables) { return "variables" + L_BRACKET + "size:" + variables.keys().size() + R_BRACKET; }
/** * Gets the variables of the {@link Graph} as a {@code Map}. */ public default Map<String, Object> asMap() { final Map<String, Object> map = keys().stream() .map(key -> Pair.with(key, get(key).get())) .collect(Collectors.toMap(Pair::getValue0, Pair::getValue1)); return Collections.unmodifiableMap(map); }
public static void testVariables(final HugeGraph graph) { // variables test Graph.Variables variables = graph.variables(); variables.set("owner", "zhangyi"); variables.set("time", 3); variables.set("owner", "zhangyi1"); variables.keys(); graph.tx().commit(); variables.remove("time"); variables.get("time"); variables.get("owner"); variables.remove("owner"); variables.get("owner"); }