public InternalLog buildObject(byte[] row, long timestamp, Map<String, byte[]> allQualifierValues) { InternalLog alertDetail = new InternalLog(); String myRow = EagleBase64Wrapper.encodeByteArray2URLSafeString(row); alertDetail.setEncodedRowkey(myRow); alertDetail.setPrefix(schema.getPrefix()); alertDetail.setSearchTags(searchTags); alertDetail.setTimestamp(timestamp); Map<String, byte[]> logQualifierValues = new HashMap<String, byte[]>(); Map<String, String> logTags = new HashMap<String, String>(); for (Map.Entry<String, byte[]> entry : allQualifierValues.entrySet()) { if (schema.isTag(entry.getKey())) { if (entry.getValue() != null) { logTags.put(entry.getKey(), new String(entry.getValue())); } } else { logQualifierValues.put(entry.getKey(), entry.getValue()); } } alertDetail.setQualifierValues(logQualifierValues); alertDetail.setTags(logTags); return alertDetail; } }
private InternalLog buildLog(Result result) { final InternalLog log = new InternalLog(); final byte[] rowkey = result.getRow(); log.setEncodedRowkey(EagleBase64Wrapper.encodeByteArray2URLSafeString(rowkey)); long timestamp = ByteUtil.bytesToLong(rowkey, 4); timestamp = Long.MAX_VALUE - timestamp; log.setTimestamp(timestamp); Map<String, byte[]> qualifierValues = new HashMap<String, byte[]>(); log.setQualifierValues(qualifierValues); NavigableMap<byte[], byte[]> map = result.getFamilyMap(this.columnFamily.getBytes()); if(map == null){ throw new NoSuchRowException(EagleBase64Wrapper.encodeByteArray2URLSafeString(rowkey)); } for(Map.Entry<byte[], byte[]> entry : map.entrySet()){ byte[] qualifier = entry.getKey(); byte[] value = entry.getValue(); qualifierValues.put(new String(qualifier), value); } return log; }
private InternalLog buildLog(Result result) { final InternalLog log = new InternalLog(); final byte[] rowkey = result.getRow(); log.setEncodedRowkey(EagleBase64Wrapper.encodeByteArray2URLSafeString(rowkey)); long timestamp = ByteUtil.bytesToLong(rowkey, 4); timestamp = Long.MAX_VALUE - timestamp; log.setTimestamp(timestamp); Map<String, byte[]> qualifierValues = new HashMap<String, byte[]>(); log.setQualifierValues(qualifierValues); NavigableMap<byte[], byte[]> map = result.getFamilyMap(this.columnFamily.getBytes()); if (map == null) { throw new NoSuchRowException(EagleBase64Wrapper.encodeByteArray2URLSafeString(rowkey)); } for (Map.Entry<byte[], byte[]> entry : map.entrySet()) { byte[] qualifier = entry.getKey(); byte[] value = entry.getValue(); qualifierValues.put(new String(qualifier), value); } return log; }
public InternalLog buildObject(byte[] row, long timestamp, Map<String, byte[]> allQualifierValues) { InternalLog alertDetail = new InternalLog(); String myRow = EagleBase64Wrapper.encodeByteArray2URLSafeString(row); alertDetail.setEncodedRowkey(myRow); alertDetail.setPrefix(schema.getPrefix()); alertDetail.setSearchTags(searchTags); alertDetail.setTimestamp(timestamp); Map<String, byte[]> logQualifierValues = new HashMap<String, byte[]>(); Map<String, String> logTags = new HashMap<String, String>(); for (Map.Entry<String, byte[]> entry : allQualifierValues.entrySet()) { if (schema.isTag(entry.getKey())) { if (entry.getValue() != null) { logTags.put(entry.getKey(), new String(entry.getValue())); } } else { logQualifierValues.put(entry.getKey(),entry.getValue()); } } alertDetail.setQualifierValues(logQualifierValues); alertDetail.setTags(logTags); return alertDetail; } }
InternalLog log = new InternalLog(); String myRow = EagleBase64Wrapper.encodeByteArray2URLSafeString(row); log.setEncodedRowkey(myRow); log.setPrefix(ed.getPrefix()); log.setTimestamp(timestamp);
InternalLog log = new InternalLog(); String myRow = EagleBase64Wrapper.encodeByteArray2URLSafeString(row); log.setEncodedRowkey(myRow); log.setPrefix(ed.getPrefix()); log.setTimestamp(timestamp);