public static final HugeKeys parseKey(String name) { return HugeKeys.valueOf(name.toUpperCase()); }
public static String formatKey(HugeKeys key) { return key.name(); }
public String column(HugeKeys column) { return this.columns.get(column.string()); }
protected byte[] formatSyspropName(Id id, HugeKeys col) { int idLen = this.keyWithIdPrefix ? 1 + id.length() : 0; BytesBuffer buffer = BytesBuffer.allocate(idLen + 1 + 1); byte sysprop = HugeType.SYS_PROPERTY.code(); if (this.keyWithIdPrefix) { buffer.writeId(id); } return buffer.write(sysprop).write(col.code()).bytes(); }
private byte[] formatColumnName(HugeKeys key) { Id id = this.entry.id().origin(); int size = 1 + id.length() + 1; BytesBuffer buffer = BytesBuffer.allocate(size); buffer.writeId(id); buffer.write(key.code()); return buffer.bytes(); } }
public void column(HugeKeys column, String value) { this.columns.put(column.string(), value); }
public static HugeKeys parseKey(String name) { return HugeKeys.valueOf(name.toUpperCase()); }
public static final String formatKey(HugeKeys key) { return key.name(); }
protected byte[] formatSyspropName(BinaryId id, HugeKeys col) { int idLen = this.keyWithIdPrefix ? id.length() : 0; BytesBuffer buffer = BytesBuffer.allocate(idLen + 1 + 1); byte sysprop = HugeType.SYS_PROPERTY.code(); if (this.keyWithIdPrefix) { buffer.write(id.asBytes()); } return buffer.write(sysprop).write(col.code()).bytes(); }
private String formatSyspropName(HugeKeys col) { return this.formatSyspropName(col.string()); }
public static HugeKeys string2HugeKey(String key) { if (key.equals(T.label.getAccessor())) { return HugeKeys.LABEL; } else if (key.equals(T.id.getAccessor())) { return HugeKeys.ID; } else if (keyForContainsKeyOrValue(key)) { return HugeKeys.PROPERTIES; } return HugeKeys.valueOf(key); }
public static final String formatKey(HugeKeys key) { return key.name(); }
protected byte[] formatSyspropName(Id id, HugeKeys col) { int idLen = this.keyWithIdPrefix ? 1 + id.length() : 0; BytesBuffer buffer = BytesBuffer.allocate(idLen + 1 + 1); byte sysprop = HugeType.SYS_PROPERTY.code(); if (this.keyWithIdPrefix) { buffer.writeId(id); } return buffer.write(sysprop).write(col.code()).bytes(); }
private static void writeEntry(JsonGenerator jsonGenerator, Map<HugeKeys, Object> schema) throws IOException { jsonGenerator.writeStartObject(); for (Map.Entry<HugeKeys, Object> entry : schema.entrySet()) { jsonGenerator.writeFieldName(entry.getKey().string()); jsonGenerator.writeObject(entry.getValue()); } jsonGenerator.writeEndObject(); }
public static final HugeKeys parseKey(String name) { return HugeKeys.valueOf(name.toUpperCase()); }
public static String formatKey(HugeKeys key) { return key.name(); }
protected byte[] formatSyspropName(BinaryId id, HugeKeys col) { int idLen = this.keyWithIdPrefix ? id.length() : 0; BytesBuffer buffer = BytesBuffer.allocate(idLen + 1 + 1); byte sysprop = HugeType.SYS_PROPERTY.code(); if (this.keyWithIdPrefix) { buffer.write(id.asBytes()); } return buffer.write(sysprop).write(col.code()).bytes(); }
public void eliminate(TextBackendEntry entry) { for (Entry<String, String> col : entry.columns.entrySet()) { String newValue = col.getValue(); String oldValue = this.column(col.getKey()); // TODO: use more general method if (col.getKey().startsWith(HugeType.PROPERTY.string()) || col.getKey().startsWith(HugeType.EDGE_OUT.string()) || col.getKey().startsWith(HugeType.EDGE_IN.string())) { this.columns.remove(col.getKey()); continue; } // TODO: use more general method if (!col.getKey().endsWith(HugeKeys.ELEMENT_IDS.string())) { continue; } // TODO: ensure the old value is a list and json format (for index) List<Object> values = new ArrayList<>(); Object[] oldValues = JsonUtil.fromJson(oldValue, Object[].class); Object[] newValues = JsonUtil.fromJson(newValue, Object[].class); values.addAll(Arrays.asList(oldValues)); values.removeAll(Arrays.asList(newValues)); // Update the old value this.column(col.getKey(), JsonUtil.toJson(values)); } }
public static HugeKeys parseKey(String name) { return HugeKeys.valueOf(name.toUpperCase()); }
public void append(TextBackendEntry entry) { for (Entry<String, String> col : entry.columns.entrySet()) { String newValue = col.getValue(); String oldValue = this.column(col.getKey()); // TODO: use more general method if (col.getKey().startsWith(HugeType.PROPERTY.string())) { this.columns.put(col.getKey(), col.getValue()); continue; } // TODO: use more general method if (!col.getKey().endsWith(HugeKeys.ELEMENT_IDS.string())) { continue; } // TODO: ensure the old value is a list and json format (for index) List<Object> values = new ArrayList<>(); Object[] oldValues = JsonUtil.fromJson(oldValue, Object[].class); Object[] newValues = JsonUtil.fromJson(newValue, Object[].class); values.addAll(Arrays.asList(oldValues)); values.addAll(Arrays.asList(newValues)); // Update the old value this.column(col.getKey(), JsonUtil.toJson(values)); } }