org.neo4j.kernel.internal.Version类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(138)

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

Version介绍

暂无

代码示例

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

UnexpectedUpgradingStoreVersionException( String fileVersion, String currentVersion )
  {
    super( String.format( MESSAGE, fileVersion, currentVersion, Version.getNeo4jVersion() ) );
  }
}

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

@Test
public void shouldExposeCleanAndDetailedVersions()
{
  assertThat( version( "1.2.3-M01,abcdef012345" ).getReleaseVersion(), equalTo( "1.2.3-M01" ));
  assertThat( version( "1.2.3-M01,abcdef012345" ).getVersion(),        equalTo( "1.2.3-M01,abcdef012345" ));
  assertThat( version( "1.2.3-M01,abcdef012345-dirty" ).getVersion(),  equalTo( "1.2.3-M01,abcdef012345-dirty" ));
  assertThat( version( "1.2.3,abcdef012345" ).getReleaseVersion(),     equalTo( "1.2.3" ));
  assertThat( version( "1.2.3,abcdef012345" ).getVersion(),            equalTo( "1.2.3,abcdef012345" ));
  assertThat( version( "1.2.3,abcdef012345-dirty" ).getVersion(),      equalTo( "1.2.3,abcdef012345-dirty" ));
  assertThat( version( "1.2.3-GA,abcdef012345" ).getReleaseVersion(),  equalTo( "1.2.3-GA" ));
  assertThat( version( "1.2.3-GA,abcdef012345" ).getVersion(),         equalTo( "1.2.3-GA,abcdef012345" ));
  assertThat( version( "1.2.3-GA,abcdef012345-dirty" ).getVersion(),   equalTo( "1.2.3-GA,abcdef012345-dirty" ));
  assertThat( version( "1.2.3M01,abcdef012345" ).getReleaseVersion(),  equalTo( "1.2.3M01" ));
  assertThat( version( "1.2.3M01,abcdef012345" ).getVersion(),         equalTo( "1.2.3M01,abcdef012345" ));
  assertThat( version( "1.2.3M01,abcdef012345-dirty" ).getVersion(),   equalTo( "1.2.3M01,abcdef012345-dirty" ));
  assertThat( version( "1.2" ).getReleaseVersion(),  equalTo( "1.2" ));
  assertThat( version( "1.2" ).getVersion(),         equalTo( "1.2" ));
  assertThat( version( "0" ).getReleaseVersion(),    equalTo( "0" ));
  assertThat( version( "0" ).getVersion(),           equalTo( "0" ));
}

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

private static void publishPlatformInfo( UsageData sysInfo )
{
  sysInfo.set( UsageDataKeys.version, Version.getNeo4jVersion() );
  sysInfo.set( UsageDataKeys.revision, Version.getKernelVersion() );
}

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

public static String getNeo4jVersion()
{
  return getKernel().getReleaseVersion();
}

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

public static String getKernelVersion()
{
  return getKernel().getVersion();
}

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

private String neoDatabaseVersion( NeoServer neoServer )
{
  return neoServer.getDatabase().getGraph().getDependencyResolver().resolveDependency( KernelData.class )
      .version().getReleaseVersion();
}

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

@Override
  void dump( Logger logger )
  {
    logger.log( "Graph Database: " + databaseInfo + " " + storeId );
    logger.log( "Kernel version: " + Version.getKernelVersion() );
  }
}

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

@Override
public String toString()
{
  StringBuilder result = new StringBuilder();
  if ( title != null )
  {
    result.append( title );
    if ( artifactId == null || !artifactId.equals( title ) )
    {
      result.append( " (" ).append( artifactId ).append( ')' );
    }
  }
  else if ( artifactId != null )
  {
    result.append( artifactId );
  }
  else
  {
    result.append( "Unknown Component" );
  }
  result.append( ", " );
  if ( title == null )
  {
    result.append( "unpackaged " );
  }
  result.append( "version: " ).append( getVersion() );
  return result.toString();
}

代码示例来源:origin: org.neo4j/neo4j-kernel

public static String getNeo4jVersion()
{
  return getKernel().getReleaseVersion();
}

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

@Test
  public void shouldReportCommunityEdition() throws Exception
  {
    // Given
    String releaseVersion = server.getDatabase().getGraph().getDependencyResolver().resolveDependency( KernelData
        .class ).version().getReleaseVersion();
    // When
    HTTP.Response res =
        HTTP.GET( functionalTestHelper.managementUri() + "/" + VersionAndEditionService.SERVER_PATH );
    // Then
    assertEquals( 200, res.status() );
    assertThat( res.get( "edition" ).asText(), equalTo( "community" ) );
    assertThat( res.get( "version" ).asText(), equalTo( releaseVersion ) );
  }
}

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

/**
 * A very nice to have main-method for quickly checking the version of a neo4j kernel,
 * for example given a kernel jar file.
 */
public static void main( String[] args )
{
  Version kernelVersion = getKernel();
  System.out.println( kernelVersion );
  System.out.println( "Title: " + kernelVersion.title );
  System.out.println( "Vendor: " + kernelVersion.vendor );
  System.out.println( "ArtifactId: " + kernelVersion.artifactId );
  System.out.println( "Version: " + kernelVersion.getVersion() );
}

代码示例来源:origin: org.neo4j/neo4j-kernel

@Override
  void dump( Logger logger )
  {
    logger.log( "Graph Database: " + databaseInfo + " " + storeId );
    logger.log( "Kernel version: " + Version.getKernelVersion() );
  }
}

代码示例来源:origin: org.neo4j/neo4j-kernel

@Override
public String toString()
{
  StringBuilder result = new StringBuilder();
  if ( title != null )
  {
    result.append( title );
    if ( artifactId == null || !artifactId.equals( title ) )
    {
      result.append( " (" ).append( artifactId ).append( ')' );
    }
  }
  else if ( artifactId != null )
  {
    result.append( artifactId );
  }
  else
  {
    result.append( "Unknown Component" );
  }
  result.append( ", " );
  if ( title == null )
  {
    result.append( "unpackaged " );
  }
  result.append( "version: " ).append( getVersion() );
  return result.toString();
}

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

public BoltStateMachineV1SPI( UsageData usageData, LogService logging,
    Authentication authentication, TransactionStateMachineSPI transactionStateMachineSPI )
{
  this.usageData = usageData;
  this.errorReporter = new ErrorReporter( logging );
  this.authentication = authentication;
  this.transactionSpi = transactionStateMachineSPI;
  this.version = BOLT_SERVER_VERSION_PREFIX + Version.getNeo4jVersion();
}

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

private static void publishPlatformInfo( UsageData sysInfo )
{
  sysInfo.set( UsageDataKeys.version, Version.getNeo4jVersion() );
  sysInfo.set( UsageDataKeys.revision, Version.getKernelVersion() );
}

代码示例来源:origin: org.neo4j.app/neo4j-server

private String neoDatabaseVersion( NeoServer neoServer )
{
  return neoServer.getDatabase().getGraph().getDependencyResolver().resolveDependency( KernelData.class )
      .version().getReleaseVersion();
}

代码示例来源:origin: org.neo4j/neo4j-kernel

public static String getKernelVersion()
{
  return getKernel().getVersion();
}

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

private static String manualReference( ManualPage page, Anchor anchor )
{
  // Docs are versioned major.minor-suffix, so drop the patch version.
  String[] versionParts = Version.getNeo4jVersion().split("-");
  versionParts[0] = versionParts[0].substring(0, 3);
  String docsVersion = String.join("-", versionParts);
  return " https://neo4j.com/docs/operations-manual/" + docsVersion + "/" +
      page.getReference( anchor );
}

代码示例来源:origin: org.neo4j/neo4j-kernel

/**
 * A very nice to have main-method for quickly checking the version of a neo4j kernel,
 * for example given a kernel jar file.
 */
public static void main( String[] args )
{
  Version kernelVersion = getKernel();
  System.out.println( kernelVersion );
  System.out.println( "Title: " + kernelVersion.title );
  System.out.println( "Vendor: " + kernelVersion.vendor );
  System.out.println( "ArtifactId: " + kernelVersion.artifactId );
  System.out.println( "Version: " + kernelVersion.getVersion() );
}

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

static void printOverview( File storeDir, Collection<Option<File[]>> nodesFiles,
    Collection<Option<File[]>> relationshipsFiles,
    org.neo4j.unsafe.impl.batchimport.Configuration configuration, PrintStream out )
{
  out.println( "Neo4j version: " + Version.getNeo4jVersion() );
  out.println( "Importing the contents of these files into " + storeDir + ":" );
  printInputFiles( "Nodes", nodesFiles, out );
  printInputFiles( "Relationships", relationshipsFiles, out );
  out.println();
  out.println( "Available resources:" );
  printIndented( "Total machine memory: " + bytes( OsBeanUtil.getTotalPhysicalMemory() ), out );
  printIndented( "Free machine memory: " + bytes( OsBeanUtil.getFreePhysicalMemory() ), out );
  printIndented( "Max heap memory : " + bytes( Runtime.getRuntime().maxMemory() ), out );
  printIndented( "Processors: " + configuration.maxNumberOfProcessors(), out );
  printIndented( "Configured max memory: " + bytes( configuration.maxMemoryUsage() ), out );
  printIndented( "High-IO: " + configuration.highIO(), out );
  out.println();
}

相关文章