@Override public synchronized String get(String path) { ensureOpen(); return userConfig.get(path); }
@Override public synchronized JanusGraphConfiguration set(String path, Object value) { ensureOpen(); return userConfig.set(path, value); } }
@Override public UserModifiableConfiguration set(String path, Object value) { ConfigElement.PathIdentifier pp = ConfigElement.parse(config.getRootNamespace(),path); Preconditions.checkArgument(pp.element.isOption(),"Need to provide configuration option - not namespace: %s",path); ConfigOption option = (ConfigOption)pp.element; verifier.verifyModification(option); if (option.getDatatype().isArray()) { Class arrayType = option.getDatatype().getComponentType(); Object arr; if (value.getClass().isArray()) { int size = Array.getLength(value); arr = Array.newInstance(arrayType,size); for (int i=0;i<size;i++) { Array.set(arr,i,convertBasic(Array.get(value,i),arrayType)); } } else { arr = Array.newInstance(arrayType,1); Array.set(arr,0,convertBasic(value,arrayType)); } value = arr; } else { value = convertBasic(value,option.getDatatype()); } config.set(option,value,pp.umbrellaElements); return this; }
public ManagementSystem(StandardJanusGraph graph, KCVSConfiguration config, Log sysLog, ManagementLogger managementLogger, SchemaCache schemaCache) { Preconditions.checkArgument(config != null && graph != null && sysLog != null && managementLogger != null); this.graph = graph; this.sysLog = sysLog; this.managementLogger = managementLogger; this.schemaCache = schemaCache; this.transactionalConfig = new TransactionalConfiguration(config); this.modifyConfig = new ModifiableConfiguration(ROOT_NS, transactionalConfig, BasicConfiguration.Restriction.GLOBAL); this.userConfig = new UserModifiableConfiguration(modifyConfig, configVerifier); this.updatedTypes = new HashSet<>(); this.evictGraphFromCache = false; this.updatedTypeTriggers = new ArrayList<>(); this.graphShutdownRequired = false; this.transaction = (StandardJanusGraphTx) graph.buildTransaction().disableBatchLoading().start(); this.txStartTime = graph.getConfiguration().getTimestampProvider().getTime(); this.isOpen = true; }