@Override public MemoryUsage getMemoryUsage(boolean forceGc) throws TException { if (forceGc) { System.gc(); //NOSONAR } MemoryUsage memUsage = new MemoryUsage(); memUsage.setMax(Runtime.getRuntime().maxMemory()); memUsage.setFree(Runtime.getRuntime().freeMemory()); memUsage.setTotal(Runtime.getRuntime().totalMemory()); return memUsage; }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof MemoryUsage) return this.equals((MemoryUsage)that); return false; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case MAX: if (value == null) { unsetMax(); } else { setMax((Long)value); } break; case TOTAL: if (value == null) { unsetTotal(); } else { setTotal((Long)value); } break; case FREE: if (value == null) { unsetFree(); } else { setFree((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 MAX: return isSetMax(); case TOTAL: return isSetTotal(); case FREE: return isSetFree(); } throw new IllegalStateException(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, getMemoryUsage_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new MemoryUsage(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.cliException = new CliThriftException(); struct.cliException.read(iprot); struct.setCliExceptionIsSet(true); } } }
public MemoryUsage deepCopy() { return new MemoryUsage(this); }
lastComparison = Boolean.valueOf(isSetMax()).compareTo(other.isSetMax()); if (lastComparison != 0) { return lastComparison; if (isSetMax()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max, other.max); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetTotal()).compareTo(other.isSetTotal()); if (lastComparison != 0) { return lastComparison; if (isSetTotal()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.total, other.total); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetFree()).compareTo(other.isSetFree()); if (lastComparison != 0) { return lastComparison; if (isSetFree()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.free, other.free); if (lastComparison != 0) {
case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new MemoryUsage(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else {
/** * Performs a deep copy on <i>other</i>. */ public getMemoryUsage_result(getMemoryUsage_result other) { if (other.isSetSuccess()) { this.success = new MemoryUsage(other.success); } if (other.isSetCliException()) { this.cliException = new CliThriftException(other.cliException); } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, MemoryUsage struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetMax()) { optionals.set(0); } if (struct.isSetTotal()) { optionals.set(1); } if (struct.isSetFree()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetMax()) { oprot.writeI64(struct.max); } if (struct.isSetTotal()) { oprot.writeI64(struct.total); } if (struct.isSetFree()) { oprot.writeI64(struct.free); } }
public boolean equals(getMemoryUsage_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_cliException = true && this.isSetCliException(); boolean that_present_cliException = true && that.isSetCliException(); if (this_present_cliException || that_present_cliException) { if (!(this_present_cliException && that_present_cliException)) return false; if (!this.cliException.equals(that.cliException)) return false; } return true; }