public Map<ConfigElement.PathIdentifier,Object> getAll() { Map<ConfigElement.PathIdentifier,Object> result = Maps.newHashMap(); for (String key : config.getKeys("")) { Preconditions.checkArgument(StringUtils.isNotBlank(key)); try { final ConfigElement.PathIdentifier pid = ConfigElement.parse(getRootNamespace(),key); Preconditions.checkArgument(pid.element.isOption() && !pid.lastIsUmbrella); result.put(pid, get((ConfigOption) pid.element, pid.umbrellaElements)); } catch (IllegalArgumentException e) { log.debug("Ignored configuration entry for {} since it does not map to an option",key,e); } } return result; }
private void checkBackwardCompatibilityWithTitan(ModifiableConfiguration globalWrite, BasicConfiguration localBasicConfiguration, KCVSConfiguration keyColumnValueStoreConfiguration, ModifiableConfiguration overwrite) { String version = globalWrite.get(TITAN_COMPATIBLE_VERSIONS); Preconditions.checkArgument(version!=null,"JanusGraph version nor Titan compatibility have not been initialized"); if (!JanusGraphConstants.TITAN_COMPATIBLE_VERSIONS.contains(version)) { throw new JanusGraphException(String.format(INCOMPATIBLE_VERSION_EXCEPTION, version, JanusGraphConstants.VERSION)); } // When connecting to a store created by Titan the ID store name will not be in the // global configuration as it was not something which was configurable with Titan. // So to ensure compatibility override the default to titan_ids. boolean localIdStoreIsDefault = JanusGraphConstants.JANUSGRAPH_ID_STORE_NAME.equals(localBasicConfiguration.get(IDS_STORE_NAME)); boolean usingTitanIdStore = localIdStoreIsDefault || JanusGraphConstants.TITAN_ID_STORE_NAME.equals(localBasicConfiguration.get(IDS_STORE_NAME)); boolean existingKeyStore = keyColumnValueStoreConfiguration.get(IDS_STORE_NAME.getName(), IDS_STORE_NAME.getDatatype()) != null; Preconditions.checkArgument(usingTitanIdStore,"ID store for Titan compatibility has not been initialized to: " + JanusGraphConstants.TITAN_ID_STORE_NAME); if (!existingKeyStore) { log.info("Setting {} to {} for Titan compatibility", IDS_STORE_NAME.getName(), JanusGraphConstants.TITAN_ID_STORE_NAME); overwrite.set(IDS_STORE_NAME, JanusGraphConstants.TITAN_ID_STORE_NAME); } }
log.info("Using configured timestamp provider {}", localBasicConfiguration.get(TIMESTAMP_PROVIDER)); allowUpgrade = localBasicConfiguration.get(ALLOW_UPGRADE); } else if (globalWrite.has(ALLOW_UPGRADE)) { allowUpgrade = globalWrite.get(ALLOW_UPGRADE); managedOverridesAllowed = localBasicConfiguration.get(ALLOW_STALE_CONFIG); else if (globalWrite.has(ALLOW_STALE_CONFIG)) managedOverridesAllowed = globalWrite.get(ALLOW_STALE_CONFIG);
final String backend = readConfig.get(INDEX_BACKEND, INDEX); switch (backend) { case "elasticsearch":
private void testIndexing(Cardinality cardinality) { if (supportsCollections()) { final PropertyKey stringProperty = mgmt.makePropertyKey("name").dataType(String.class).cardinality(cardinality).make(); final PropertyKey intProperty = mgmt.makePropertyKey("age").dataType(Integer.class).cardinality(cardinality).make(); final PropertyKey longProperty = mgmt.makePropertyKey("long").dataType(Long.class).cardinality(cardinality).make(); final PropertyKey uuidProperty = mgmt.makePropertyKey("uuid").dataType(UUID.class).cardinality(cardinality).make(); final PropertyKey geopointProperty = mgmt.makePropertyKey("geopoint").dataType(Geoshape.class).cardinality(cardinality).make(); mgmt.buildIndex("collectionIndex", Vertex.class).addKey(stringProperty, getStringMapping()).addKey(intProperty).addKey(longProperty).addKey(uuidProperty).addKey(geopointProperty).buildMixedIndex(INDEX); finishSchema(); testCollection(cardinality, "name", "Totoro", "Hiro"); testCollection(cardinality, "age", 1, 2); testCollection(cardinality, "long", 1L, 2L); testCollection(cardinality, "geopoint", Geoshape.point(1.0, 1.0), Geoshape.point(2.0, 2.0)); final String backend = readConfig.get(INDEX_BACKEND, INDEX); // Solr 6 has issues processing UUIDs with Multivalues // https://issues.apache.org/jira/browse/SOLR-11264 if (!"solr".equals(backend)) { testCollection(cardinality, "uuid", UUID.randomUUID(), UUID.randomUUID()); } } else { try { final PropertyKey stringProperty = mgmt.makePropertyKey("name").dataType(String.class).cardinality(cardinality).make(); //This should throw an exception mgmt.buildIndex("collectionIndex", Vertex.class).addKey(stringProperty, getStringMapping()).buildMixedIndex(INDEX); Assert.fail("Should have thrown an exception"); } catch (final JanusGraphException ignored) { } } }
, option(MAX_COMMIT_TIME), Duration.ofSeconds(1) , option(STORAGE_WRITE_WAITTIME), Duration.ofMillis(300) , option(TestMockIndexProvider.INDEX_BACKEND_PROXY, INDEX), readConfig.get(INDEX_BACKEND, INDEX) , option(INDEX_BACKEND, INDEX), TestMockIndexProvider.class.getName() , option(TestMockIndexProvider.INDEX_MOCK_FAILADD, INDEX), true