private void dbStoreVersion(Version state) throws IOException { String key = TIMELINE_STORE_VERSION_KEY; byte[] data = ((VersionPBImpl) state).getProto().toByteArray(); try { db.put(bytes(key), data); } catch (DBException e) { throw new IOException(e); } }
@VisibleForTesting Version loadVersion() throws IOException { try { byte[] data = db.get(TIMELINE_STATE_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( YarnServerCommonProtos.VersionProto.parseFrom(data)); return version; } catch (DBException e) { throw new IOException(e); } }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasMajorVersion()) { hash = (37 * hash) + MAJOR_VERSION_FIELD_NUMBER; hash = (53 * hash) + getMajorVersion(); } if (hasMinorVersion()) { hash = (37 * hash) + MINOR_VERSION_FIELD_NUMBER; hash = (53 * hash) + getMinorVersion(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto)) { return super.equals(obj); } org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto other = (org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto) obj; boolean result = true; result = result && (hasMajorVersion() == other.hasMajorVersion()); if (hasMajorVersion()) { result = result && (getMajorVersion() == other.getMajorVersion()); } result = result && (hasMinorVersion() == other.hasMinorVersion()); if (hasMinorVersion()) { result = result && (getMinorVersion() == other.getMinorVersion()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto)) { return super.equals(obj); } org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto other = (org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto) obj; boolean result = true; result = result && (hasMajorVersion() == other.hasMajorVersion()); if (hasMajorVersion()) { result = result && (getMajorVersion() == other.getMajorVersion()); } result = result && (hasMinorVersion() == other.hasMinorVersion()); if (hasMinorVersion()) { result = result && (getMinorVersion() == other.getMinorVersion()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto)) { return super.equals(obj); } org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto other = (org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto) obj; boolean result = true; result = result && (hasMajorVersion() == other.hasMajorVersion()); if (hasMajorVersion()) { result = result && (getMajorVersion() == other.getMajorVersion()); } result = result && (hasMinorVersion() == other.hasMinorVersion()); if (hasMinorVersion()) { result = result && (getMinorVersion() == other.getMinorVersion()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasMajorVersion()) { hash = (37 * hash) + MAJOR_VERSION_FIELD_NUMBER; hash = (53 * hash) + getMajorVersion(); } if (hasMinorVersion()) { hash = (37 * hash) + MINOR_VERSION_FIELD_NUMBER; hash = (53 * hash) + getMinorVersion(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasMajorVersion()) { hash = (37 * hash) + MAJOR_VERSION_FIELD_NUMBER; hash = (53 * hash) + getMajorVersion(); } if (hasMinorVersion()) { hash = (37 * hash) + MINOR_VERSION_FIELD_NUMBER; hash = (53 * hash) + getMinorVersion(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
public org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto buildPartial() { org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto result = new org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.majorVersion_ = majorVersion_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.minorVersion_ = minorVersion_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
@VisibleForTesting Version loadVersion() throws IOException { try { byte[] data = db.get(TIMELINE_STATE_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( YarnServerCommonProtos.VersionProto.parseFrom(data)); return version; } catch (DBException e) { throw new IOException(e); } }
@VisibleForTesting Version loadVersion() throws IOException { try { byte[] data = db.get(TIMELINE_STATE_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( YarnServerCommonProtos.VersionProto.parseFrom(data)); return version; } catch (DBException e) { throw new IOException(e); } }
public org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto buildPartial() { org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto result = new org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.majorVersion_ = majorVersion_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.minorVersion_ = minorVersion_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto buildPartial() { org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto result = new org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.majorVersion_ = majorVersion_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.minorVersion_ = minorVersion_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto getDefaultInstanceForType() { return org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto.getDefaultInstance(); }
public org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto getDefaultInstanceForType() { return org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto.getDefaultInstance(); }
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); } }
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); } }
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); } }
public org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto getDefaultInstanceForType() { return org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto.getDefaultInstance(); }
@Override public Version getConfStoreVersion() throws Exception { Version version = null; try { byte[] data = db.get(bytes(VERSION_KEY)); if (data != null) { version = new VersionPBImpl(YarnServerCommonProtos.VersionProto .parseFrom(data)); } } catch (DBException e) { throw new IOException(e); } return version; }