/** * Get the Dremio major version from pom * @return x if assuming the version number is x.y.z */ public static int getMajorVersion() { return VERSION.getMajorVersion(); }
/** * Get the Dremio minor version from pom * @return y if assuming the version number is x.y.z */ public static int getMinorVersion() { return VERSION.getMinorVersion(); }
/** * Get the Dremio version from pom * @return the version number as x.y.z */ public static String getVersion() { return VERSION.getVersion(); }
@Test public void testBuildNumberVersion() { Version version = new Version("3.1.5-2-BUGFIX", 3, 1, 5, 2, "BUGFIX"); assertEquals("3.1.5-2-BUGFIX", version.getVersion()); assertEquals(3, version.getMajorVersion()); assertEquals(1, version.getMinorVersion()); assertEquals(5, version.getPatchVersion()); assertEquals(2, version.getBuildNumber()); assertEquals("BUGFIX", version.getQualifier()); }
public static ClusterVersion toClusterVersion(Version version) { return new ClusterVersion() .setMajor(version.getMajorVersion()) .setMinor(version.getMinorVersion()) .setBuildNumber(version.getBuildNumber()) .setPatch(version.getPatchVersion()) .setQualifier(version.getQualifier()); }
/** * Get the version from a {@code RpcEndpointInfos} instance */ public static Version getVersion(RpcEndpointInfos infos) { return new Version( infos.getVersion(), infos.getMajorVersion(), infos.getMinorVersion(), infos.getPatchVersion(), infos.getBuildNumber(), infos.getVersionQualifier()); }
/** * Get the Dremio patch version from pom * @return z if assuming the version number is x.y.z(-suffix) */ public static int getPatchVersion() { return VERSION.getPatchVersion(); }
/** * Get the Dremio version qualifier from pom * @return suffix if assuming the version number is x.y.z(-suffix), or an empty string */ public static String getQualifier() { return VERSION.getQualifier(); } }
if (serverVersion.compareTo(minVersion) >= 0) { builder.add(capability);
@Test public void testReleaseVersion() { Version version = new Version("2.1.4", 2, 1, 4, 0, ""); assertEquals("2.1.4", version.getVersion()); assertEquals(2, version.getMajorVersion()); assertEquals(1, version.getMinorVersion()); assertEquals(4, version.getPatchVersion()); assertEquals(0, version.getBuildNumber()); assertEquals("", version.getQualifier()); }
public static Version fromClusterVersion(ClusterVersion version) { if (version == null) { return null; } return new Version( String.format("%d.%d.%d-%s", version.getMajor(), version.getMinor(), version.getPatch(), version.getQualifier()), // not really needed when comparing versions version.getMajor(), version.getMinor(), version.getPatch(), version.getBuildNumber(), version.getQualifier()); }
/** * Get the Dremio build number from pom * @return z if assuming the version number is x.y.z(.b)(-suffix) */ public static int getBuildNumber() { return VERSION.getPatchVersion(); }
@Test public void testSnapshotVersion() { Version version = new Version("1.2.3-SNAPSHOT", 1, 2, 3, 0, "SNAPSHOT"); assertEquals("1.2.3-SNAPSHOT", version.getVersion()); assertEquals(1, version.getMajorVersion()); assertEquals(2, version.getMinorVersion()); assertEquals(3, version.getPatchVersion()); assertEquals(0, version.getBuildNumber()); assertEquals("SNAPSHOT", version.getQualifier()); }
@Override protected void ensureUpgradeSupported(Version storeVersion) { // Check if store version is up to date, i.e store version is greater or equal to the greatest version // of all upgrade tasks. If not, and if auto upgrade is not enabled, fail. if (!getDACConfig().isAutoUpgrade()) { Preconditions.checkState( UPGRADE_VERSION_ORDERING.compare(storeVersion, VERSION) >= 0, "KVStore has an older version (%s) than the server (%s), please run the upgrade tool first", storeVersion.getVersion(), VERSION.getVersion()); } // Check if store version is smaller or equal to the code version. // If not, and if not allowed by config, fail. // Needed to be able to run multiple versions of Dremio on single version of KVStore if (getDACConfig().allowNewerKVStore) { logger.warn(String.format( "This Dremio version %s is older then KVStore version %s", VERSION.getVersion(), storeVersion.getVersion())); } else { Preconditions.checkState( UPGRADE_VERSION_ORDERING.compare(storeVersion, VERSION) <= 0, "KVStore has a newer version (%s) than running Dremio server (%s)", storeVersion.getVersion(), VERSION.getVersion()); } } }
@Override public int getDatabaseMajorVersion() throws SQLException { throwIfClosed(); Version version = getServerVersion(); if (version == null) { return super.getDatabaseMajorVersion(); } return version.getMajorVersion(); }
@Override public int getDatabaseMinorVersion() throws SQLException { throwIfClosed(); Version version = getServerVersion(); if (version == null) { return super.getDatabaseMinorVersion(); } return version.getMinorVersion(); }
@Override public String getDatabaseProductVersion() throws SQLException { throwIfClosed(); Version version = getServerVersion(); if (version == null) { return super.getDatabaseProductVersion(); } return version.getVersion(); }
System.out.println("KVStore version is " + kvStoreVersion.getVersion()); ensureUpgradeSupported(kvStoreVersion);