@Override public ReadableBlobMeta getBlobMeta(String key) throws KeyNotFoundException { validateKey(key); if (!checkForBlobOrDownload(key)) { checkForBlobUpdate(key); } SettableBlobMeta meta = getStoredBlobMeta(key); ReadableBlobMeta rbm = new ReadableBlobMeta(); rbm.set_settable(meta); try { LocalFsBlobStoreFile pf = fbs.read(DATA_PREFIX + key); rbm.set_version(pf.getModTime()); } catch (IOException e) { throw new RuntimeException(e); } return rbm; }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof ReadableBlobMeta) return this.equals((ReadableBlobMeta)that); return false; }
public Object getFieldValue(_Fields field) { switch (field) { case SETTABLE: return get_settable(); case VERSION: return Long.valueOf(get_version()); } throw new IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case SETTABLE: if (value == null) { unset_settable(); } else { set_settable((SettableBlobMeta)value); } break; case VERSION: if (value == null) { unset_version(); } else { set_version((Long)value); } break; } }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SETTABLE: return is_set_settable(); case VERSION: return is_set_version(); } throw new IllegalStateException(); }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!is_set_settable()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'settable' is unset! Struct:" + toString()); } if (!is_set_version()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'version' is unset! Struct:" + toString()); } // check for sub-struct validity if (settable != null) { settable.validate(); } }
struct.settable = new SettableBlobMeta(); struct.settable.read(iprot); struct.set_settable_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.version = iprot.readI64(); struct.set_version_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ReadableBlobMeta struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.settable = new SettableBlobMeta(); struct.settable.read(iprot); struct.set_settable_isSet(true); struct.version = iprot.readI64(); struct.set_version_isSet(true); } }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_settable = true && (is_set_settable()); list.add(present_settable); if (present_settable) list.add(settable); boolean present_version = true; list.add(present_version); if (present_version) list.add(version); return list.hashCode(); }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
public ReadableBlobMeta deepCopy() { return new ReadableBlobMeta(this); }
remoteBlobStore.setClient(conf, client); in = remoteBlobStore.getBlob(key); blobStore.createBlob(key, in, rbm.get_settable());
public void setFieldValue(_Fields field, Object value) { switch (field) { case SETTABLE: if (value == null) { unset_settable(); } else { set_settable((SettableBlobMeta)value); } break; case VERSION: if (value == null) { unset_version(); } else { set_version((Long)value); } break; } }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!is_set_settable()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'settable' is unset! Struct:" + toString()); } if (!is_set_version()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'version' is unset! Struct:" + toString()); } // check for sub-struct validity if (settable != null) { settable.validate(); } }
struct.settable = new SettableBlobMeta(); struct.settable.read(iprot); struct.set_settable_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.version = iprot.readI64(); struct.set_version_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public int compareTo(ReadableBlobMeta other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(is_set_settable()).compareTo(other.is_set_settable()); if (lastComparison != 0) { return lastComparison; } if (is_set_settable()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.settable, other.settable); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_version()).compareTo(other.is_set_version()); if (lastComparison != 0) { return lastComparison; } if (is_set_version()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); if (lastComparison != 0) { return lastComparison; } } return 0; }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ReadableBlobMeta struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.settable = new SettableBlobMeta(); struct.settable.read(iprot); struct.set_settable_isSet(true); struct.version = iprot.readI64(); struct.set_version_isSet(true); } }
public boolean equals(ReadableBlobMeta that) { if (that == null) return false; boolean this_present_settable = true && this.is_set_settable(); boolean that_present_settable = true && that.is_set_settable(); if (this_present_settable || that_present_settable) { if (!(this_present_settable && that_present_settable)) return false; if (!this.settable.equals(that.settable)) return false; } boolean this_present_version = true; boolean that_present_version = true; if (this_present_version || that_present_version) { if (!(this_present_version && that_present_version)) return false; if (this.version != that.version) return false; } return true; }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
public ReadableBlobMeta deepCopy() { return new ReadableBlobMeta(this); }