/** * Get bin value as list. */ public List<?> getList(String name) { return (List<?>)getValue(name); }
/** * Get bin value as String. */ public String getString(String name) { return (String)getValue(name); }
/** * Get bin value as map. */ public Map<?,?> getMap(String name) { return (Map<?,?>)getValue(name); }
/** * Get bin value as GeoJSON Value. */ public GeoJSONValue getGeoJSONValue(String name) { return (GeoJSONValue) getValue(name); }
/** * Get bin value as map. */ public Map<?,?> getMap(String name) { return (Map<?,?>)getValue(name); }
/** * Get bin value as String. */ public String getString(String name) { return (String)getValue(name); }
/** * Get bin value as long. */ public long getLong(String name) { // The server always returns numbers as longs if bin found. // If bin not found, the result will be null. Convert null to zero. Object result = getValue(name); return (result != null)? (Long)result : 0; }
/** * Get bin value as GeoJSON Value. */ public GeoJSONValue getGeoJSONValue(String name) { return (GeoJSONValue) getValue(name); }
/** * Get bin value as long. */ public long getLong(String name) { // The server always returns numbers as longs if bin found. // If bin not found, the result will be null. Convert null to zero. Object result = getValue(name); return (result != null)? (Long)result : 0; }
/** * Get bin value as list. */ public List<?> getList(String name) { return (List<?>)getValue(name); }
/** * Get bin value as GeoJSON String. */ public String getGeoJSONString(String name) { return getValue(name).toString(); }
/** * Get bin value as double. */ public double getDouble(String name) { // The server may return number as double or long. // Convert bits if returned as long. Object result = getValue(name); return (result instanceof Double)? (Double)result : (result != null)? Double.longBitsToDouble((Long)result) : 0.0; }
/** * Get bin value as GeoJSON String. */ public String getGeoJSONString(String name) { return getValue(name).toString(); }
/** * Get bin value as double. */ public double getDouble(String name) { // The server may return number as double or long. // Convert bits if returned as long. Object result = getValue(name); return (result instanceof Double)? (Double)result : (result != null)? Double.longBitsToDouble((Long)result) : 0.0; }
private ValueWrapper toWrapper(Record record) { return (record != null ? new SimpleValueWrapper(record.getValue(VALUE)) : null); }
private void validateBin(Key key, Bin bin, Record record) { Object received = record.getValue(bin.name); String expected = bin.value.toString(); if (received != null && received.equals(expected)) { console.info("Bin matched: namespace=%s set=%s key=%s bin=%s value=%s generation=%d expiration=%d", key.namespace, key.setName, key.userKey, bin.name, received, record.generation, record.expiration); } else { console.error("Put/Get mismatch: Expected %s. Received %s.", expected, received); } }
private void validateBin(Key key, Bin bin, Record record, String id) { Object received = (record == null)? null : record.getValue(bin.name); String expected = bin.value.toString(); if (received != null && received.equals(expected)) { console.info("Bin matched %s: namespace=%s set=%s key=%s bin=%s value=%s", id, key.namespace, key.setName, key.userKey, bin.name, received); } else { console.error("Put/Get mismatch: Expected %s. Received %s.", expected, received); } } }
private void validateBin(Key key, Bin bin, Record record) { Object received = record.getValue(bin.name); String expected = bin.value.toString(); if (received != null && received.equals(expected)) { console.info("Data matched: namespace=%s set=%s key=%s bin=%s value=%s generation=%d expiration=%d", key.namespace, key.setName, key.userKey, bin.name, received, record.generation, record.expiration); } else { console.error("Data mismatch: Expected %s. Received %s.", expected, received); } } }
public void onRecord(Key key, Record record) { Level level = Level.ERROR; Object value = null; if (record != null) { level = Level.INFO; value = record.getValue(binName); } console.write(level, "Record: ns=%s set=%s digest=%s bin=%s value=%s", key.namespace, key.setName, Buffer.bytesToHexString(key.digest), binName, value); }
@Override public long getCommittedWindowId(String appId, int operatorId) { try { lastWindowFetchCommand.setFilters(Filter.equal(metaTableOperatorIdColumn, operatorId)); lastWindowFetchCommand.setFilters(Filter.equal(metaTableAppIdColumn, appId)); long lastWindow = -1; RecordSet recordSet = client.query(null, lastWindowFetchCommand); while(recordSet.next()) { lastWindow = Long.parseLong(recordSet.getRecord().getValue(metaTableWindowColumn).toString()); } return lastWindow; } catch (AerospikeException ex) { throw new RuntimeException(ex); } }