Skip to content

Commit

Permalink
Renaming version() to getServiceVersion().
Browse files Browse the repository at this point in the history
  • Loading branch information
jsimsa committed Nov 13, 2015
1 parent d451180 commit a3e1527
Show file tree
Hide file tree
Showing 17 changed files with 399 additions and 398 deletions.
Expand Up @@ -59,15 +59,15 @@ protected String getServiceName() {
@Override @Override
protected void afterConnect() { protected void afterConnect() {
mClient = new BlockMasterService.Client(mProtocol); mClient = new BlockMasterService.Client(mProtocol);
if (mServerVersion == Constants.UNKNOWN_SERVICE_VERSION) { if (mServiceVersion == Constants.UNKNOWN_SERVICE_VERSION) {
try { try {
mServerVersion = mClient.version(); mServiceVersion = mClient.getServiceVersion();
} catch (TException e) { } catch (TException e) {
throw new RuntimeException(e.getMessage()); throw new RuntimeException(e.getMessage());
} }
if (!mCompatibleVersions.contains(mServerVersion)) { if (!mCompatibleVersions.contains(mServiceVersion)) {
throw new RuntimeException(ExceptionMessage.INCOMPATIBLE_VERSION.getMessage( throw new RuntimeException(ExceptionMessage.INCOMPATIBLE_VERSION.getMessage(
Constants.BLOCK_MASTER_SERVICE_VERSION, mServerVersion)); Constants.BLOCK_MASTER_SERVICE_VERSION, mServiceVersion));
} }
} }
} }
Expand Down
Expand Up @@ -63,15 +63,15 @@ protected String getServiceName() {
@Override @Override
protected void afterConnect() { protected void afterConnect() {
mClient = new FileSystemMasterService.Client(mProtocol); mClient = new FileSystemMasterService.Client(mProtocol);
if (mServerVersion == Constants.UNKNOWN_SERVICE_VERSION) { if (mServiceVersion == Constants.UNKNOWN_SERVICE_VERSION) {
try { try {
mServerVersion = mClient.version(); mServiceVersion = mClient.getServiceVersion();
} catch (TException e) { } catch (TException e) {
throw new RuntimeException(e.getMessage()); throw new RuntimeException(e.getMessage());
} }
if (!mCompatibleVersions.contains(mServerVersion)) { if (!mCompatibleVersions.contains(mServiceVersion)) {
throw new RuntimeException(ExceptionMessage.INCOMPATIBLE_VERSION.getMessage( throw new RuntimeException(ExceptionMessage.INCOMPATIBLE_VERSION.getMessage(
Constants.FILE_SYSTEM_MASTER_SERVICE_VERSION, mServerVersion)); Constants.FILE_SYSTEM_MASTER_SERVICE_VERSION, mServiceVersion));
} }
} }
} }
Expand Down
Expand Up @@ -59,15 +59,15 @@ protected String getServiceName() {
@Override @Override
protected void afterConnect() { protected void afterConnect() {
mClient = new RawTableMasterService.Client(mProtocol); mClient = new RawTableMasterService.Client(mProtocol);
if (mServerVersion == Constants.UNKNOWN_SERVICE_VERSION) { if (mServiceVersion == Constants.UNKNOWN_SERVICE_VERSION) {
try { try {
mServerVersion = mClient.version(); mServiceVersion = mClient.getServiceVersion();
} catch (TException e) { } catch (TException e) {
throw new RuntimeException(e.getMessage()); throw new RuntimeException(e.getMessage());
} }
if (!mCompatibleVersions.contains(mServerVersion)) { if (!mCompatibleVersions.contains(mServiceVersion)) {
throw new RuntimeException(ExceptionMessage.INCOMPATIBLE_VERSION.getMessage( throw new RuntimeException(ExceptionMessage.INCOMPATIBLE_VERSION.getMessage(
Constants.RAW_TABLE_MASTER_SERVICE_VERSION, mServerVersion)); Constants.RAW_TABLE_MASTER_SERVICE_VERSION, mServiceVersion));
} }
} }
} }
Expand Down
Expand Up @@ -59,15 +59,15 @@ protected String getServiceName() {
@Override @Override
protected void afterConnect() { protected void afterConnect() {
mClient = new LineageMasterService.Client(mProtocol); mClient = new LineageMasterService.Client(mProtocol);
if (mServerVersion == Constants.UNKNOWN_SERVICE_VERSION) { if (mServiceVersion == Constants.UNKNOWN_SERVICE_VERSION) {
try { try {
mServerVersion = mClient.version(); mServiceVersion = mClient.getServiceVersion();
} catch (TException e) { } catch (TException e) {
throw new RuntimeException(e.getMessage()); throw new RuntimeException(e.getMessage());
} }
if (!mCompatibleVersions.contains(mServerVersion)) { if (!mCompatibleVersions.contains(mServiceVersion)) {
throw new RuntimeException(ExceptionMessage.INCOMPATIBLE_VERSION.getMessage( throw new RuntimeException(ExceptionMessage.INCOMPATIBLE_VERSION.getMessage(
Constants.LINEAGE_MASTER_SERVICE_VERSION, mServerVersion)); Constants.LINEAGE_MASTER_SERVICE_VERSION, mServiceVersion));
} }
} }
} }
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/java/tachyon/MasterClientBase.java
Expand Up @@ -37,7 +37,7 @@ public abstract class MasterClientBase extends ClientBase {


protected final boolean mUseZookeeper; protected final boolean mUseZookeeper;
protected Set<Long> mCompatibleVersions; protected Set<Long> mCompatibleVersions;
protected long mServerVersion; protected long mServiceVersion;


/** /**
* Creates a new master client base. * Creates a new master client base.
Expand All @@ -49,7 +49,7 @@ public MasterClientBase(InetSocketAddress masterAddress, TachyonConf tachyonConf
super(masterAddress, tachyonConf, "master"); super(masterAddress, tachyonConf, "master");
mUseZookeeper = mTachyonConf.getBoolean(Constants.ZOOKEEPER_ENABLED); mUseZookeeper = mTachyonConf.getBoolean(Constants.ZOOKEEPER_ENABLED);
mCompatibleVersions = new HashSet<Long>(); mCompatibleVersions = new HashSet<Long>();
mServerVersion = Constants.UNKNOWN_SERVICE_VERSION; mServiceVersion = Constants.UNKNOWN_SERVICE_VERSION;
} }


/** /**
Expand Down

0 comments on commit a3e1527

Please sign in to comment.