org.neo4j.kernel.configuration.Config.augment()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.neo4j.kernel.configuration.Config.augment()方法的一些代码示例,展示了Config.augment()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.augment()方法的具体详情如下:
包路径:org.neo4j.kernel.configuration.Config
类名称:Config
方法名:augment

Config.augment介绍

暂无

代码示例

代码示例来源:origin: neo4j/neo4j

/**
 * Augment the existing config with new settings, overriding any conflicting settings, but keeping all old
 * non-overlapping ones.
 *
 * @param config config to add and override with.
 * @throws InvalidSettingException when and invalid setting is found and {@link
 * GraphDatabaseSettings#strict_config_validation} is true.
 */
public void augment( Config config ) throws InvalidSettingException
{
  augment( config.params );
}

代码示例来源:origin: neo4j/neo4j

private static Config withForcedInMemoryConfiguration( Config config )
{
  config.augment( ephemeral, TRUE );
  config.augmentDefaults( pagecache_memory, "8M" );
  return config;
}

代码示例来源:origin: neo4j/neo4j

/**
 * @see Config#augment(Map)
 */
public void augment( String setting, String value ) throws InvalidSettingException
{
  augment( singletonMap( setting, value ) );
}

代码示例来源:origin: neo4j/neo4j

@Deprecated
  @Override
  protected void addPropertyDirect( String key, Object value )
  {
    config.augment( key, value.toString() );
  }
}

代码示例来源:origin: neo4j/neo4j

protected GraphDatabaseService newDatabase( File storeDir, Config config,
                      GraphDatabaseFacadeFactory.Dependencies dependencies )
{
  File absoluteStoreDir = storeDir.getAbsoluteFile();
  File databasesRoot = absoluteStoreDir.getParentFile();
  config.augment( GraphDatabaseSettings.ephemeral, Settings.FALSE );
  config.augment( GraphDatabaseSettings.active_database, absoluteStoreDir.getName() );
  config.augment( GraphDatabaseSettings.databases_root_path, databasesRoot.getAbsolutePath() );
  return getGraphDatabaseFacadeFactory().newFacade( databasesRoot, config, dependencies );
}

代码示例来源:origin: neo4j/neo4j

/**
 * @see Config#augment(Map)
 */
public void augment( Setting<?> setting, String value )
{
  augment( setting.name(), value );
}

代码示例来源:origin: neo4j/neo4j

private static Consumer<Config> overrideWithDiscoverable( String uri )
{
  return config -> config.augment( ServerSettings.bolt_discoverable_address, uri );
}

代码示例来源:origin: neo4j/neo4j

private static File defaultReportDir( Config tuningConfiguration, File storeDir )
{
  if ( tuningConfiguration.get( GraphDatabaseSettings.neo4j_home ) == null )
  {
    tuningConfiguration.augment( GraphDatabaseSettings.neo4j_home, storeDir.getAbsolutePath() );
    tuningConfiguration.augment( GraphDatabaseSettings.database_path, storeDir.getAbsolutePath() );
  }
  return tuningConfiguration.get( GraphDatabaseSettings.logs_directory );
}

代码示例来源:origin: neo4j/neo4j

private static Config loadNeo4jConfig( Path homeDir, Path configDir, String databaseName, Config additionalConfig )
{
  Config config = Config.fromFile( configDir.resolve( Config.DEFAULT_CONFIG_FILE_NAME ) )
      .withHome( homeDir )
      .withConnectorsDisabled()
      .withNoThrowOnFileLoadFailure()
      .build();
  config.augment( additionalConfig );
  config.augment( GraphDatabaseSettings.active_database, databaseName );
  return config;
}

代码示例来源:origin: neo4j/neo4j

private static Config loadNeo4jConfig( Path homeDir, Path configDir, String databaseName, Config additionalConfig )
  {
    Config config = Config.fromFile( configDir.resolve( Config.DEFAULT_CONFIG_FILE_NAME ) )
        .withHome( homeDir )
        .withConnectorsDisabled()
        .withNoThrowOnFileLoadFailure()
        .build();
    config.augment( additionalConfig );
    config.augment( GraphDatabaseSettings.active_database, databaseName );
    return config;
  }
}

代码示例来源:origin: neo4j/neo4j

private static Config getNeo4jConfig( Configuration config, Config dbConfig )
{
  dbConfig.augment( stringMap(
      dense_node_threshold.name(), valueOf( config.denseNodeThreshold() ),
      pagecache_memory.name(), valueOf( config.pageCacheMemory() ) ) );
  return dbConfig;
}

代码示例来源:origin: neo4j/neo4j

protected void publishEditionInfo( UsageData sysInfo, DatabaseInfo databaseInfo, Config config )
{
  sysInfo.set( UsageDataKeys.edition, databaseInfo.edition );
  sysInfo.set( UsageDataKeys.operationalMode, databaseInfo.operationalMode );
  config.augment( GraphDatabaseSettings.editionName, databaseInfo.edition.toString() );
}

代码示例来源:origin: neo4j/neo4j

protected void withIntervalTx( int count )
{
  config.augment( stringMap( GraphDatabaseSettings.check_point_interval_tx.name(), String.valueOf( count ) ) );
}

代码示例来源:origin: neo4j/neo4j

protected void withIntervalTime( String time )
{
  config.augment( stringMap( GraphDatabaseSettings.check_point_interval_time.name(), time ) );
}

代码示例来源:origin: neo4j/neo4j

@Test
public void shouldBeAbleToAugmentConfig()
{
  // Given
  Config config = Config();
  // When
  config.augment( MySettingsWithDefaults.boolSetting, Settings.FALSE );
  config.augment( MySettingsWithDefaults.hello, "Bye" );
  // Then
  assertThat( config.get( MySettingsWithDefaults.boolSetting ), equalTo( false ) );
  assertThat( config.get( MySettingsWithDefaults.hello ), equalTo( "Bye" ) );
}

代码示例来源:origin: neo4j/neo4j

@Test
public void augmentAnotherConfig()
{
  Config config = Config();
  config.augment( MySettingsWithDefaults.hello, "Hi" );
  Config anotherConfig = Config();
  anotherConfig.augment( stringMap( MySettingsWithDefaults.boolSetting.name(),
      Settings.FALSE, MySettingsWithDefaults.hello.name(), "Bye" ) );
  config.augment( anotherConfig );
  assertThat( config.get( MySettingsWithDefaults.boolSetting ), equalTo( false ) );
  assertThat( config.get( MySettingsWithDefaults.hello ), equalTo( "Bye" ) );
}

代码示例来源:origin: neo4j/neo4j

private static Consumer<Config> overrideWithAdvertisedAddress( String host, int port )
{
  return config -> config.augment( new BoltConnector( "bolt" ).advertised_address.name(), AdvertisedSocketAddress.advertisedAddress( host, port ) );
}

代码示例来源:origin: neo4j/neo4j

@Test
public void rebuildIdGeneratorSlowMustThrowOnPageOverflow() throws Exception
{
  config.augment( GraphDatabaseSettings.rebuild_idgenerators_fast, "false" );
  createStore();
  store.setStoreNotOk( new RuntimeException() );
  IntRecord record = new IntRecord( 200 );
  record.value = 0xCAFEBABE;
  store.updateRecord( record );
  intsPerRecord = 8192;
  assertThrowsUnderlyingStorageException( () -> store.makeStoreOk() );
}

代码示例来源:origin: neo4j/neo4j

@Test
public void isConfigured()
{
  Config config = Config();
  assertFalse( config.isConfigured( MySettingsWithDefaults.hello ) );
  config.augment( MySettingsWithDefaults.hello, "Hi" );
  assertTrue( config.isConfigured( MySettingsWithDefaults.hello ) );
}

代码示例来源:origin: neo4j/neo4j

@Override
  public GraphDatabaseFacade newGraphDatabase( Config config, GraphDatabaseFacadeFactory.Dependencies dependencies )
  {
    File storeDir = config.get( GraphDatabaseSettings.database_path );
    config.augment( stringMap( GraphDatabaseSettings.ephemeral.name(), "true",
        new BoltConnector( "bolt" ).listen_address.name(), "localhost:0" ) );
    return new ImpermanentGraphDatabase( storeDir, config, GraphDatabaseDependencies.newDependencies( dependencies ) );
  }
}

相关文章