private Operation(Type type) { this.type = type; this.binName = null; this.value = Value.getAsNull(); } }
private Operation(Type type) { this.type = type; this.binName = null; this.value = Value.getAsNull(); } }
private Operation(Type type, String binName) { this.type = type; this.binName = binName; this.value = Value.getAsNull(); }
private Operation(Type type, String binName) { this.type = type; this.binName = binName; this.value = Value.getAsNull(); }
/** * Create bin with a null value. This is useful for bin deletions within a record. * For servers configured as "single-bin", enter a null or empty name. * * @param name bin name, current limit is 14 characters */ public static Bin asNull(String name) { return new Bin(name, Value.getAsNull()); }
/** * Create bin with a null value. This is useful for bin deletions within a record. * For servers configured as "single-bin", enter a null or empty name. * * @param name bin name, current limit is 14 characters */ public static Bin asNull(String name) { return new Bin(name, Value.getAsNull()); }
end.add(Value.getAsNull());
private static Value genValue(RandomShift random, DBObjectSpec spec, long keySeed) { switch (spec.type) { case 'I': if (keySeed == -1) { return Value.get(random.nextInt()); } else { return Value.get(keySeed); } case 'B': byte[] ba = new byte[spec.size]; random.nextBytes(ba); return Value.get(ba); case 'S': StringBuilder sb = new StringBuilder(spec.size); for (int i = 0; i < spec.size; i++) { // Append ascii value between ordinal 33 and 127. sb.append((char)(random.nextInt(94) + 33)); } return Value.get(sb.toString()); case 'D': return Value.get(System.currentTimeMillis()); default: return Value.getAsNull(); } } }
protected static Operation createRangeOperation(int command, Operation.Type type, String binName, Value begin, Value end, int returnType) { Packer packer = new Packer(); packer.packRawShort(command); if (begin == null) { begin = Value.getAsNull(); } if (end == null) { packer.packArrayBegin(2); packer.packInt(returnType); begin.pack(packer); } else { packer.packArrayBegin(3); packer.packInt(returnType); begin.pack(packer); end.pack(packer); } return new Operation(type, binName, Value.get(packer.toByteArray())); } }
protected static Operation createRangeOperation(int command, Operation.Type type, String binName, Value begin, Value end, int returnType) { Packer packer = new Packer(); packer.packRawShort(command); if (begin == null) { begin = Value.getAsNull(); } if (end == null) { packer.packArrayBegin(2); packer.packInt(returnType); begin.pack(packer); } else { packer.packArrayBegin(3); packer.packInt(returnType); begin.pack(packer); end.pack(packer); } return new Operation(type, binName, Value.get(packer.toByteArray())); } }