public static long getTimestamp(byte[] rowkey, EntityDefinition ed) { if (!ed.isTimeSeries()) { return EntityConstants.FIXED_WRITE_TIMESTAMP; } final int offset = (ed.getPartitions() == null) ? 4 : (4 + ed.getPartitions().length * 4); return Long.MAX_VALUE - ByteUtil.bytesToLong(rowkey, offset); }
public static long getTimestamp(byte[] rowkey, EntityDefinition ed) { if (!ed.isTimeSeries()) { return EntityConstants.FIXED_WRITE_TIMESTAMP; } final int offset = (ed.getPartitions() == null) ? 4 : (4 + ed.getPartitions().length * 4); return Long.MAX_VALUE - ByteUtil.bytesToLong(rowkey, offset); }
private int[] generatePartitionHashCodes(TaggedLogAPIEntity entity) { final String[] partitions = entityDef.getPartitions(); int[] result = null; if (partitions != null) { result = new int[partitions.length]; final Map<String, String> tags = entity.getTags(); for (int i = 0; i < partitions.length; ++i) { final String partition = partitions[i]; final String tagValue = tags.get(partition); if (tagValue != null) { result[i] = tagValue.hashCode(); } else { result[i] = EMPTY_PARTITION_DEFAULT_HASH_CODE; } } } return result; }
private int[] generatePartitionHashCodes(TaggedLogAPIEntity entity) { final String[] partitions = entityDef.getPartitions(); int[] result = null; if (partitions != null) { result = new int[partitions.length]; final Map<String, String> tags = entity.getTags(); for (int i = 0 ; i < partitions.length; ++i) { final String partition = partitions[i]; final String tagValue = tags.get(partition); if (tagValue != null) { result[i] = tagValue.hashCode(); } else { result[i] = EMPTY_PARTITION_DEFAULT_HASH_CODE; } } } return result; }
final byte[] row = r.getRow(); final int offset = (ed.getPartitions() == null) ? (4) : (4 + ed.getPartitions().length * 4); long timestamp = ByteUtil.bytesToLong(row, offset);
final byte[] row = r.getRow(); final int offset = (ed.getPartitions() == null) ? (4) : (4 + ed.getPartitions().length * 4); long timestamp = ByteUtil.bytesToLong(row, offset);
public byte[] generateIndexRowkey(TaggedLogAPIEntity entity) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { if (entity.getClass() != entityDef.getEntityClass()) { throw new IllegalArgumentException("Expected entity class: " + entityDef.getEntityClass().getName() + ", but got class " + entity.getClass().getName()); } final byte[][] indexValues = generateIndexValues(entity); final int[] partitionHashCodes = generatePartitionHashCodes(entity); SortedMap<Integer, Integer> tagMap = null; if (!index.unique()) { // non cluster index tagMap = RowkeyBuilder.generateSortedTagMap(entityDef.getPartitions(), entity.getTags()); } return generateUniqueIndexRowkey(indexValues, partitionHashCodes, tagMap); }
public byte[] generateIndexRowkey(TaggedLogAPIEntity entity) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { if (entity.getClass() != entityDef.getEntityClass()) { throw new IllegalArgumentException("Expected entity class: " + entityDef.getEntityClass().getName() + ", but got class " + entity.getClass().getName()); } final byte[][] indexValues = generateIndexValues(entity); final int[] partitionHashCodes = generatePartitionHashCodes(entity); SortedMap<Integer, Integer> tagMap = null; if (!index.unique()) { // non cluster index tagMap = RowkeyBuilder.generateSortedTagMap(entityDef.getPartitions(), entity.getTags()); } return generateUniqueIndexRowkey(indexValues, partitionHashCodes, tagMap); }
node.put("columnFamily",def.getColumnFamily()); node.put("prefix",def.getPrefix()); if(def.getPartitions()!=null){ node.put("partitions",arrayNode(def.getPartitions()));
this.endTime = endTime; this.ed = ed; if (ed.getPartitions() != null) { if (partitions == null || ed.getPartitions().length != partitions.size()) { throw new IllegalArgumentException("Invalid argument. Entity " + ed.getClass().getSimpleName() + " defined "
this.endTime = endTime; this._ed = ed; if (_ed.getPartitions() != null) { if (partitions == null || _ed.getPartitions().length != partitions.size()) { throw new IllegalArgumentException("Invalid argument. Entity " + ed.getClass().getSimpleName() + " defined " + "partitions, but argument partitions is null or number of partition values are different!");
EntityDefinition ed = EntityDefinitionManager.getEntityByServiceName(_serviceName); if(qy == null || qy.isEmpty()){ if (ed.getPartitions() == null) { if(LOG.isDebugEnabled()) LOG.warn("Query string is empty, full table scan query: " + qy);
final String[] partitions = ed.getPartitions(); if (partitions == null || partitions.length == 0) { return null;
final String[] partitions = _ed.getPartitions(); if (partitions == null || partitions.length == 0) { return null;
final String[] partitions = entityDef.getPartitions(); int[] partitionValueHashs = null; if (partitions != null) {
log.setPartitions(entityDef.getPartitions()); EntitySerDeserializer des = new EntitySerDeserializer(); log.setQualifierValues(des.writeValue(entity, entityDef));
log.setPartitions(entityDef.getPartitions()); EntitySerDeserializer des = new EntitySerDeserializer(); log.setQualifierValues(des.writeValue(entity, entityDef));
public void setEntityDefinition(EntityDefinition ed) { this.entityClass = ed.getEntityClass(); this.table = ed.getTable(); this.columnFamily = ed.getColumnFamily(); this.prefix = ed.getPrefix(); this.service = ed.getService(); this.partitions = ed.getPartitions(); this.displayNameMap = ed.getDisplayNameMap(); this.qualifierGetterMap = ed.getQualifierGetterMap(); this.qualifierNameMap = ed.getQualifierNameMap(); this.isTimeSeries = ed.isTimeSeries(); this.metricDefinition = ed.metricDefinition; this.indexes = ed.getIndexes(); }
public void setEntityDefinition(EntityDefinition ed){ this.entityClass = ed.getEntityClass(); this.table = ed.getTable(); this.columnFamily = ed.getColumnFamily(); this.prefix = ed.getPrefix(); this.service = ed.getService(); this.partitions = ed.getPartitions(); this.displayNameMap = ed.getDisplayNameMap(); this.qualifierGetterMap = ed.getQualifierGetterMap(); this.qualifierNameMap = ed.getQualifierNameMap(); this.isTimeSeries = ed.isTimeSeries(); this.metricDefinition = ed.metricDefinition; this.indexes = ed.getIndexes(); }
node.put("columnFamily",def.getColumnFamily()); node.put("prefix",def.getPrefix()); if(def.getPartitions()!=null){ node.put("partitions",arrayNode(def.getPartitions()));