Tabnine Logo
Configuration.has
Code IndexAdd Tabnine to your IDE (free)

How to use
has
method
in
org.janusgraph.diskstorage.configuration.Configuration

Best Java code snippets using org.janusgraph.diskstorage.configuration.Configuration.has (Showing top 20 results out of 315)

origin: JanusGraph/janusgraph

@Override
public boolean has(ConfigOption option, String... umbrellaElements) {
  return first.has(option, umbrellaElements) || second.has(option, umbrellaElements);
}
origin: JanusGraph/janusgraph

private static String getSuffix(Configuration config) {
  final String suffix;
  if (config.has(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID_SUFFIX)) {
    suffix = LongEncoding.encode(config.get(
        GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID_SUFFIX));
  } else if (!config.has(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID_HOSTNAME)) {
    suffix = ManagementFactory.getRuntimeMXBean().getName() + LongEncoding.encode(INSTANCE_COUNTER.incrementAndGet());
  } else {
    suffix = "";
  }
  return suffix;
}
origin: JanusGraph/janusgraph

@Override
public <O> O get(ConfigOption<O> option, String... umbrellaElements) {
  if (first.has(option, umbrellaElements))
    return first.get(option, umbrellaElements);
  if (second.has(option, umbrellaElements))
    return second.get(option, umbrellaElements);
  return option.getDefaultValue();
}
@Override
origin: JanusGraph/janusgraph

@Override
public boolean has(ConfigOption option, String... umbrellaElements) {
  if (option.getNamespace().hasUmbrella())
    return config.has(option,concat(umbrellaElements));
  else
    return config.has(option);
}
origin: JanusGraph/janusgraph

private void configureMetricsSlf4jReporter() {
  if (configuration.has(METRICS_SLF4J_INTERVAL)) {
    // null loggerName is allowed -- that means Metrics will use its internal default
    MetricManager.INSTANCE.addSlf4jReporter(configuration.get(METRICS_SLF4J_INTERVAL),
        configuration.has(METRICS_SLF4J_LOGGER) ? configuration.get(METRICS_SLF4J_LOGGER) : null);
  }
}
origin: JanusGraph/janusgraph

private void configureMetricsConsoleReporter() {
  if (configuration.has(METRICS_CONSOLE_INTERVAL)) {
    MetricManager.INSTANCE.addConsoleReporter(configuration.get(METRICS_CONSOLE_INTERVAL));
  }
}
origin: JanusGraph/janusgraph

public static String getOrGenerateUniqueInstanceId(Configuration config) {
  String uid;
  if (!config.has(UNIQUE_INSTANCE_ID)) {
    uid = computeUniqueInstanceId(config);
    log.info("Generated {}={}", UNIQUE_INSTANCE_ID.getName(), uid);
  } else {
    uid = config.get(UNIQUE_INSTANCE_ID);
  }
  Preconditions.checkArgument(!StringUtils.containsAny(uid,ConfigElement.ILLEGAL_CHARS),"Invalid unique identifier: %s",uid);
  return uid;
}
origin: JanusGraph/janusgraph

  public LocalStoreManager(Configuration storageConfig) throws BackendException {
    super(storageConfig);
    Preconditions.checkArgument(storageConfig.has(STORAGE_DIRECTORY) ||
                  (storageConfig.has(STORAGE_ROOT) && storageConfig.has(GRAPH_NAME)),
                  String.format("Please supply configuration parameter \"%s\" or both \"%s\" and \"%s\".",
                         STORAGE_DIRECTORY.toStringWithoutRoot(),
                         STORAGE_ROOT.toStringWithoutRoot(),
                         GRAPH_NAME.toStringWithoutRoot()
                  ));
    if (storageConfig.has(STORAGE_DIRECTORY)) {
      final String storageDir = storageConfig.get(STORAGE_DIRECTORY);
      directory = DirectoryUtil.getOrCreateDataDirectory(storageDir);
    } else {
      final String storageRoot = storageConfig.get(STORAGE_ROOT);
      final String graphName = storageConfig.get(GRAPH_NAME);
      directory = DirectoryUtil.getOrCreateDataDirectory(storageRoot, graphName);
    }
  }
}
origin: JanusGraph/janusgraph

Preconditions.checkArgument(configuration.has(CUSTOM_SERIALIZER_CLASS, attributeId));
String serializerName = configuration.get(CUSTOM_SERIALIZER_CLASS, attributeId);
try {
origin: JanusGraph/janusgraph

private void configureMetricsCsvReporter() {
  if (configuration.has(METRICS_CSV_DIR)) {
    MetricManager.INSTANCE.addCsvReporter(configuration.get(METRICS_CSV_INTERVAL), configuration.get(METRICS_CSV_DIR));
  }
}
origin: JanusGraph/janusgraph

private void configureMetricsGangliaReporter() {
  if (configuration.has(GANGLIA_HOST_OR_GROUP)) {
    final String host = configuration.get(GANGLIA_HOST_OR_GROUP);
    final Duration intervalDuration = configuration.get(GANGLIA_INTERVAL);
    final Integer port = configuration.get(GANGLIA_PORT);
    final UDPAddressingMode addressingMode;
    final String addressingModeString = configuration.get(GANGLIA_ADDRESSING_MODE);
    if (addressingModeString.equalsIgnoreCase("multicast")) {
      addressingMode = UDPAddressingMode.MULTICAST;
    } else if (addressingModeString.equalsIgnoreCase("unicast")) {
      addressingMode = UDPAddressingMode.UNICAST;
    } else throw new AssertionError();
    final Boolean proto31 = configuration.get(GANGLIA_USE_PROTOCOL_31);
    final int ttl = configuration.get(GANGLIA_TTL);
    final UUID uuid = configuration.has(GANGLIA_UUID)? UUID.fromString(configuration.get(GANGLIA_UUID)):null;
    String spoof = null;
    if (configuration.has(GANGLIA_SPOOF)) spoof = configuration.get(GANGLIA_SPOOF);
    try {
      MetricManager.INSTANCE.addGangliaReporter(host, port, addressingMode, ttl, proto31, uuid, spoof, intervalDuration);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
}
origin: JanusGraph/janusgraph

private static String getUid(Configuration config) {
  final String localHostErrMsg = "Cannot determine local host";
  final String uid;
  if (config.has(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID_HOSTNAME)
   && config.get(GraphDatabaseConfiguration.UNIQUE_INSTANCE_ID_HOSTNAME)) {
    try {
      uid = Inet4Address.getLocalHost().getHostName();
    } catch (UnknownHostException e) {
      throw new JanusGraphConfigurationException(localHostErrMsg, e);
    }
  } else {
    final byte[] addrBytes;
    try {
      addrBytes = Inet4Address.getLocalHost().getAddress();
    } catch (UnknownHostException e) {
      throw new JanusGraphConfigurationException(localHostErrMsg, e);
    }
    uid = new String(Hex.encodeHex(addrBytes));
  }
  return uid;
}
origin: JanusGraph/janusgraph

public DistributedStoreManager(Configuration storageConfig, int portDefault) {
  super(storageConfig);
  this.hostnames = storageConfig.get(STORAGE_HOSTS);
  Preconditions.checkArgument(hostnames.length > 0, "No hostname configured");
  if (storageConfig.has(STORAGE_PORT)) this.port = storageConfig.get(STORAGE_PORT);
  else this.port = portDefault;
  this.connectionTimeoutMS = storageConfig.get(CONNECTION_TIMEOUT);
  this.pageSize = storageConfig.get(PAGE_SIZE);
  this.times = storageConfig.get(TIMESTAMP_PROVIDER);
  if (storageConfig.has(AUTH_USERNAME)) {
    this.username = storageConfig.get(AUTH_USERNAME);
    this.password = storageConfig.get(AUTH_PASSWORD);
  } else {
    this.username=null;
    this.password=null;
  }
}
origin: JanusGraph/janusgraph

metrics.incrementCustom(SETUP_COUNT);
if (config.has(HEX_QUERIES)) {
  String queryStrings[] = config.get(HEX_QUERIES).split(":");
  List<SliceQuery> queries = new LinkedList<>();
if (config.has(KEY_FILTER_ID_MODULUS)) {
  final long mod = config.get(KEY_FILTER_ID_MODULUS);
  final long modVal;
  if (config.has(KEY_FILTER_ID_MODULAR_VALUE)) {
    modVal = config.get(KEY_FILTER_ID_MODULAR_VALUE);
  } else {
origin: JanusGraph/janusgraph

private void configureMetricsGraphiteReporter() {
  if (configuration.has(GRAPHITE_HOST)) {
    MetricManager.INSTANCE.addGraphiteReporter(configuration.get(GRAPHITE_HOST),
        configuration.get(GRAPHITE_PORT),
        configuration.get(GRAPHITE_PREFIX),
        configuration.get(GRAPHITE_INTERVAL));
  }
}
origin: JanusGraph/janusgraph

@Override
public void workerIterationStart(Configuration jobConfig, Configuration graphConfig, ScanMetrics metrics) {
  super.workerIterationStart(jobConfig, graphConfig, metrics);
  Preconditions.checkArgument(jobConfig.has(GraphDatabaseConfiguration.JOB_START_TIME),"Invalid configuration for this job. Start time is required.");
  this.jobStartTime = Instant.ofEpochMilli(jobConfig.get(GraphDatabaseConfiguration.JOB_START_TIME));
  assert tx!=null && tx.isOpen();
  tx.rollback();
  StandardTransactionBuilder txb = graph.get().buildTransaction();
  txb.commitTime(jobStartTime);
  txb.checkExternalVertexExistence(false);
  txb.checkInternalVertexExistence(false);
  tx = (StandardJanusGraphTx)txb.start();
}
origin: JanusGraph/janusgraph

public void workerIterationStart(JanusGraph graph, Configuration config, ScanMetrics metrics) {
  this.graph = (StandardJanusGraph)graph;
  Preconditions.checkArgument(config.has(GraphDatabaseConfiguration.JOB_START_TIME),"Invalid configuration for this job. Start time is required.");
  this.jobStartTime = Instant.ofEpochMilli(config.get(GraphDatabaseConfiguration.JOB_START_TIME));
  if (indexName == null) {
    Preconditions.checkArgument(config.has(INDEX_NAME), "Need to configure the name of the index to be repaired");
    indexName = config.get(INDEX_NAME);
    indexRelationTypeName = config.get(INDEX_RELATION_TYPE);
origin: JanusGraph/janusgraph

  Preconditions.checkArgument(!config.has(IDAUTHORITY_CAV_TAG),"Conflicting configuration: a unique id and randomization have been set");
  randomizeUniqueId = true;
  randomUniqueIDLimit = config.get(IDAUTHORITY_CAV_RETRIES);
} else {
  randomizeUniqueId = false;
  Preconditions.checkArgument(!config.has(IDAUTHORITY_CAV_RETRIES),"Retry count is only meaningful when " + IDAUTHORITY_CONFLICT_AVOIDANCE + " is set to " + ConflictAvoidanceMode.GLOBAL_AUTO);
  randomUniqueIDLimit = 0;
  if (conflictAvoidanceMode.equals(ConflictAvoidanceMode.LOCAL_MANUAL)) {
    Preconditions.checkArgument(config.has(IDAUTHORITY_CAV_TAG),"Need to configure a unique id in order to use local consistency");
    storeTxConfigBuilder.customOptions(manager.getFeatures().getLocalKeyConsistentTxConfig());
  } else {
origin: JanusGraph/janusgraph

         final int[] readPartitionIds) {
Preconditions.checkArgument(storeManager!=null && config!=null);
if (config.has(LOG_STORE_TTL)) {
  indexStoreTTL = ConversionHelper.getTTLSeconds(config.get(LOG_STORE_TTL));
  StoreFeatures storeFeatures = storeManager.getFeatures();
if (config.has(LOG_MAX_PARTITIONS)) maxPartitions = config.get(LOG_MAX_PARTITIONS);
else maxPartitions = Math.max(1,config.get(CLUSTER_MAX_PARTITIONS)/CLUSTER_SIZE_DIVIDER);
Preconditions.checkArgument(maxPartitions<=config.get(CLUSTER_MAX_PARTITIONS),
origin: JanusGraph/janusgraph

private void preLoadConfiguration() {
  readOnly = configuration.get(STORAGE_READONLY);
  flushIDs = configuration.get(IDS_FLUSH);
  forceIndexUsage = configuration.get(FORCE_INDEX_USAGE);
  batchLoading = configuration.get(STORAGE_BATCH);
  String autoTypeMakerName = configuration.get(AUTO_TYPE);
  if (preregisteredAutoType.containsKey(autoTypeMakerName))
    defaultSchemaMaker = preregisteredAutoType.get(autoTypeMakerName);
  else defaultSchemaMaker = ConfigurationUtil.instantiate(autoTypeMakerName);
  //Disable auto-type making when batch-loading is enabled since that may overwrite types without warning
  if (batchLoading) defaultSchemaMaker = DisableDefaultSchemaMaker.INSTANCE;
  hasDisabledSchemaConstraints = !configuration.get(SCHEMA_CONSTRAINTS);
  txVertexCacheSize = configuration.get(TX_CACHE_SIZE);
  //Check for explicit dirty vertex cache size first, then fall back on batch-loading-dependent default
  if (configuration.has(TX_DIRTY_SIZE)) {
    txDirtyVertexSize = configuration.get(TX_DIRTY_SIZE);
  } else {
    txDirtyVertexSize = batchLoading ?
        TX_DIRTY_SIZE_DEFAULT_WITH_BATCH :
        TX_DIRTY_SIZE_DEFAULT_WITHOUT_BATCH;
  }
  propertyPrefetching = configuration.get(PROPERTY_PREFETCHING);
  useMultiQuery = configuration.get(USE_MULTIQUERY);
  adjustQueryLimit = configuration.get(ADJUST_LIMIT);
  allowVertexIdSetting = configuration.get(ALLOW_SETTING_VERTEX_ID);
  logTransactions = configuration.get(SYSTEM_LOG_TRANSACTIONS);
  unknownIndexKeyName = configuration.get(IGNORE_UNKNOWN_INDEX_FIELD) ? UNKNOWN_FIELD_NAME : null;
  configureMetrics();
}
org.janusgraph.diskstorage.configurationConfigurationhas

Popular methods of Configuration

  • get
  • getSubset
  • getContainedNamespaces
  • restrictTo

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getApplicationContext (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top plugins for Android Studio
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