Java Code Examples for org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto

The following examples show how to use org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: hadoop   Source File: NMLeveldbStateStoreService.java    License: Apache License 2.0 5 votes vote down vote up
Version loadVersion() throws IOException {
  byte[] data = db.get(bytes(DB_SCHEMA_VERSION_KEY));
  // if version is not stored previously, treat it as CURRENT_VERSION_INFO.
  if (data == null || data.length == 0) {
    return getCurrentVersion();
  }
  Version version =
      new VersionPBImpl(VersionProto.parseFrom(data));
  return version;
}
 
Example 2
Source Project: hadoop   Source File: ZKRMStateStore.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected synchronized Version loadVersion() throws Exception {
  String versionNodePath = getNodePath(zkRootNodePath, VERSION_NODE);

  if (existsWithRetries(versionNodePath, false) != null) {
    byte[] data = getDataWithRetries(versionNodePath, false);
    Version version =
        new VersionPBImpl(VersionProto.parseFrom(data));
    return version;
  }
  return null;
}
 
Example 3
Source Project: hadoop   Source File: FileSystemRMStateStore.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected synchronized Version loadVersion() throws Exception {
  Path versionNodePath = getNodePath(rootDirPath, VERSION_NODE);
  FileStatus status = getFileStatusWithRetries(versionNodePath);
  if (status != null) {
    byte[] data = readFileWithRetries(versionNodePath, status.getLen());
    Version version =
        new VersionPBImpl(VersionProto.parseFrom(data));
    return version;
  }
  return null;
}
 
Example 4
Source Project: hadoop   Source File: LeveldbTimelineStore.java    License: Apache License 2.0 5 votes vote down vote up
Version loadVersion() throws IOException {
  try {
    byte[] data = db.get(bytes(TIMELINE_STORE_VERSION_KEY));
    // if version is not stored previously, treat it as CURRENT_VERSION_INFO.
    if (data == null || data.length == 0) {
      return getCurrentVersion();
    }
    Version version =
        new VersionPBImpl(VersionProto.parseFrom(data));
    return version;
  } catch(DBException e) {
    throw new IOException(e);    	
  }
}
 
Example 5
Source Project: hadoop   Source File: ShuffleHandler.java    License: Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
Version loadVersion() throws IOException {
  byte[] data = stateDb.get(bytes(STATE_DB_SCHEMA_VERSION_KEY));
  // if version is not stored previously, treat it as CURRENT_VERSION_INFO.
  if (data == null || data.length == 0) {
    return getCurrentVersion();
  }
  Version version =
      new VersionPBImpl(VersionProto.parseFrom(data));
  return version;
}
 
Example 6
Version loadVersion() throws IOException {
  byte[] data = db.get(bytes(DB_SCHEMA_VERSION_KEY));
  // if version is not stored previously, treat it as 1.0.
  if (data == null || data.length == 0) {
    return Version.newInstance(1, 0);
  }
  Version version =
      new VersionPBImpl(VersionProto.parseFrom(data));
  return version;
}
 
Example 7
Source Project: big-c   Source File: NMLeveldbStateStoreService.java    License: Apache License 2.0 5 votes vote down vote up
Version loadVersion() throws IOException {
  byte[] data = db.get(bytes(DB_SCHEMA_VERSION_KEY));
  // if version is not stored previously, treat it as CURRENT_VERSION_INFO.
  if (data == null || data.length == 0) {
    return getCurrentVersion();
  }
  Version version =
      new VersionPBImpl(VersionProto.parseFrom(data));
  return version;
}
 
Example 8
Source Project: big-c   Source File: ZKRMStateStore.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected synchronized Version loadVersion() throws Exception {
  String versionNodePath = getNodePath(zkRootNodePath, VERSION_NODE);

  if (existsWithRetries(versionNodePath, false) != null) {
    byte[] data = getDataWithRetries(versionNodePath, false);
    Version version =
        new VersionPBImpl(VersionProto.parseFrom(data));
    return version;
  }
  return null;
}
 
Example 9
Source Project: big-c   Source File: FileSystemRMStateStore.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected synchronized Version loadVersion() throws Exception {
  Path versionNodePath = getNodePath(rootDirPath, VERSION_NODE);
  FileStatus status = getFileStatusWithRetries(versionNodePath);
  if (status != null) {
    byte[] data = readFileWithRetries(versionNodePath, status.getLen());
    Version version =
        new VersionPBImpl(VersionProto.parseFrom(data));
    return version;
  }
  return null;
}
 
Example 10
Source Project: big-c   Source File: LeveldbTimelineStore.java    License: Apache License 2.0 5 votes vote down vote up
Version loadVersion() throws IOException {
  try {
    byte[] data = db.get(bytes(TIMELINE_STORE_VERSION_KEY));
    // if version is not stored previously, treat it as CURRENT_VERSION_INFO.
    if (data == null || data.length == 0) {
      return getCurrentVersion();
    }
    Version version =
        new VersionPBImpl(VersionProto.parseFrom(data));
    return version;
  } catch(DBException e) {
    throw new IOException(e);    	
  }
}
 
Example 11
Source Project: big-c   Source File: ShuffleHandler.java    License: Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
Version loadVersion() throws IOException {
  byte[] data = stateDb.get(bytes(STATE_DB_SCHEMA_VERSION_KEY));
  // if version is not stored previously, treat it as CURRENT_VERSION_INFO.
  if (data == null || data.length == 0) {
    return getCurrentVersion();
  }
  Version version =
      new VersionPBImpl(VersionProto.parseFrom(data));
  return version;
}
 
Example 12
Version loadVersion() throws IOException {
  byte[] data = db.get(bytes(DB_SCHEMA_VERSION_KEY));
  // if version is not stored previously, treat it as 1.0.
  if (data == null || data.length == 0) {
    return Version.newInstance(1, 0);
  }
  Version version =
      new VersionPBImpl(VersionProto.parseFrom(data));
  return version;
}
 
Example 13
Source Project: tez   Source File: ShuffleHandler.java    License: Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
Version loadVersion() throws IOException {
  byte[] data = stateDb.get(bytes(STATE_DB_SCHEMA_VERSION_KEY));
  // if version is not stored previously, treat it as CURRENT_VERSION_INFO.
  if (data == null || data.length == 0) {
    return getCurrentVersion();
  }
  Version version =
      new VersionPBImpl(VersionProto.parseFrom(data));
  return version;
}
 
Example 14
Source Project: hadoop   Source File: VersionPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
public VersionPBImpl() {
  builder = VersionProto.newBuilder();
}
 
Example 15
Source Project: hadoop   Source File: VersionPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
public VersionPBImpl(VersionProto proto) {
  this.proto = proto;
  viaProto = true;
}
 
Example 16
Source Project: hadoop   Source File: VersionPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
public VersionProto getProto() {
  proto = viaProto ? proto : builder.build();
  viaProto = true;
  return proto;
}
 
Example 17
Source Project: hadoop   Source File: VersionPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private void maybeInitBuilder() {
  if (viaProto || builder == null) {
    builder = VersionProto.newBuilder(proto);
  }
  viaProto = false;
}
 
Example 18
Source Project: big-c   Source File: VersionPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
public VersionPBImpl() {
  builder = VersionProto.newBuilder();
}
 
Example 19
Source Project: big-c   Source File: VersionPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
public VersionPBImpl(VersionProto proto) {
  this.proto = proto;
  viaProto = true;
}
 
Example 20
Source Project: big-c   Source File: VersionPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
public VersionProto getProto() {
  proto = viaProto ? proto : builder.build();
  viaProto = true;
  return proto;
}
 
Example 21
Source Project: big-c   Source File: VersionPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private void maybeInitBuilder() {
  if (viaProto || builder == null) {
    builder = VersionProto.newBuilder(proto);
  }
  viaProto = false;
}