@Override public String getType() { return "Berkeley DB Java Edition " + JEVersion.CURRENT_VERSION.toString(); }
/** * Converts a numeric version string to a JEVersion, returning null for an * empty string. */ static JEVersion parseJEVersion(final String versionString) { return versionString.isEmpty() ? null : new JEVersion(versionString); }
@Override public long countAll() throws FetchException { JEVersion v = JEVersion.CURRENT_VERSION; if (v.getMajor() == 3 && v.getMinor() < 1) { // Older versions of JE don't support the direct count // operation. Major versions older than 3 are rejected completely // by the JE_Repository constructor. return super.countAll(); } IsolationLevel level = getRepository().getTransactionIsolationLevel(); if (level != null && level.isAtLeast(IsolationLevel.REPEATABLE_READ)) { // Database count operation is non-transactional. return super.countAll(); } try { return mDatabase.count(); } catch (DatabaseException e) { throw mRepository.toFetchException(e); } }
/** * Returns the highest format version supported by the specified JE * version. * * @param jeVersion the JE version * @return the highest format version supported by that JE version */ public static int getMaxFormatVersion(final JEVersion jeVersion) { if (jeVersion.compareTo(FORMAT_VERSION_3_JE_VERSION) < 0) { return FORMAT_VERSION_2; } return FORMAT_VERSION_3; }
" could not be determined," + " but this feature requires version " + requiredJEVersion.getNumericVersionString() + " or later."); "Secondary nodes are not currently supported." + " Node " + e.nodeName + " is running version " + e.nodeVersion.getNumericVersionString() + ", but this feature requires version " + requiredJEVersion.getNumericVersionString() + " or later."); if (node.getJEVersion().compareTo(minJEVersion) < 0) { throw new IllegalStateException( "The node does not meet the minimum required version" +
exTransformer.setPanicHandler(builder.getPanicHandler()); if (JEVersion.CURRENT_VERSION.getMajor() < 3) {
return false; if (!minJEVersion.equals(other.minJEVersion)) { return false;
@Override public boolean equals(Object o) { return (o instanceof JEVersion) && (compareTo((JEVersion) o) == 0); }
return false; } else if (!jeVersion.equals(other.getJEVersion())) { return false;
/** * prints terms of use for Berkeley DB JE */ public void printLicense() { String license = "\n*************************************************************************************\n" + "Berkeley DB Java Edition version: " + JEVersion.CURRENT_VERSION.toString() + "\n" + "Infinispan can use Berkeley DB Java Edition from Oracle \n" + "(http://www.oracle.com/database/berkeley-db/je/index.html)\n" + "for persistent, reliable and transaction-protected data storage.\n" + "If you choose to use Berkeley DB Java Edition with Infinispan, you must comply with the terms\n" + "of Oracle's public license, included in the file LICENSE.txt.\n" + "If you prefer not to release the source code for your own application in order to comply\n" + "with the Oracle public license, you may purchase a different license for use of\n" + "Berkeley DB Java Edition with Infinispan.\n" + "See http://www.oracle.com/database/berkeley-db/je/index.html for pricing and license terms\n" + "*************************************************************************************"; System.out.println(license); }
public int compareTo(JEVersion comparedVersion) { int result = 0; if (majorNum == comparedVersion.getMajor()) { if (minorNum == comparedVersion.getMinor()) { if (patchNum > comparedVersion.getPatch()) { result = 1; } else if (patchNum < comparedVersion.getPatch()) { result = -1; } } else if (minorNum > comparedVersion.getMinor()) { result = 1; } else { result = -1; } } else if (majorNum > comparedVersion.getMajor()) { result = 1; } else { result = -1; } return result; }
/** * Gets the protocol version that corresponds to the specified JE version, * throwing an IllegalArgumentException if the version is not supported. */ static int getJEVersionProtocolVersion(final JEVersion jeVersion) { if (jeVersion == null) { return VERSION_9; } else if (jeVersion.compareTo(VERSION_9_JE_VERSION) >= 0) { return VERSION_9; } else if (jeVersion.compareTo(VERSION_8_JE_VERSION) >= 0) { return VERSION_8; } else if (jeVersion.compareTo(VERSION_7_JE_VERSION) >= 0) { return VERSION_7; } else if (jeVersion.compareTo(VERSION_6_JE_VERSION) >= 0) { return VERSION_6; } else if (jeVersion.compareTo(VERSION_5_JE_VERSION) >= 0) { return VERSION_5; } else if (jeVersion.compareTo(VERSION_4_JE_VERSION) >= 0) { return VERSION_4; } else if (jeVersion.compareTo(VERSION_3_JE_VERSION) >= 0) { return VERSION_3; } else { throw new IllegalArgumentException( "JE version not supported: " + jeVersion); } }
/** * Returns the JE version most recently noted running on the associated * node, or null if not known. */ public JEVersion getJEVersion() { return !jeVersion.isEmpty() ? new JEVersion(jeVersion) : null; } }
/** * Update the information stored for the master in the RepGroupDB if * storing it is supported and the current version is different from the * recorded version. */ private void maybeUpdateMasterJEVersion() { /* Check if storing JE version information is supported */ if (group.getFormatVersion() < RepGroupImpl.FORMAT_VERSION_3) { return; } final JEVersion currentJEVersion = repImpl.getCurrentJEVersion(); final RepNodeImpl node = group.getMember(nameIdPair.getName()); if (currentJEVersion.equals(node.getJEVersion())) { return; } node.updateJEVersion(currentJEVersion); repGroupDB.updateMember(node, false); }
@Override public ByteBuffer wireFormat() { /* * If the appState is null, make a new zero byte array, since * writing null byte array would cause a NPE, and a meaningful * application state shouldn't be a zero length byte array. */ byte[] realAppState = (appState == null ? new byte[0] : appState); return wireFormat(nodeName, groupName, masterName, jeVersion.toString(), joinTime, nodeState, commitVLSN, masterCommitVLSN, activeFeeders, logVersion, realAppState, systemLoad); }
if (jeVersion.compareTo(other.jeVersion) != 0) { return false;
public FeederJEVersions(ByteBuffer buffer) { super(buffer); if (configuredVersion < VERSION_7){ return; } this.minJEVersion = new JEVersion(getString(buffer)); }
!nodeGroup.getJEVersion().equals(node.getJEVersion())) {
/** * Does nothing since start() does all the work. */ @Override public void create() throws Exception { String license = "\n*************************************************************************************\n" + "Berkeley DB Java Edition version: " + JEVersion.CURRENT_VERSION.toString() + "\n" + "JBoss Cache can use Berkeley DB Java Edition from Oracle \n" + "(http://www.oracle.com/database/berkeley-db/je/index.html)\n" + "for persistent, reliable and transaction-protected data storage.\n" + "If you choose to use Berkeley DB Java Edition with JBoss Cache, you must comply with the terms\n" + "of Oracle's public license, included in the file LICENSE.txt.\n" + "If you prefer not to release the source code for your own application in order to comply\n" + "with the Oracle public license, you may purchase a different license for use of\n" + "Berkeley DB Java Edition with JBoss Cache.\n" + "See http://www.oracle.com/database/berkeley-db/je/index.html for pricing and license terms\n" + "*************************************************************************************"; System.out.println(license); log.trace("Creating BdbjeCacheLoader instance."); checkNotOpen(); }