AddressComparator(final int seed) { this.hashFunction = LongHashFunction.xx(seed); this.hashCache = new HashMap<>(); }
public ScopeAndMetricOnlySchemaRecordList(List<ScopeAndMetricOnlySchemaRecord> records, HashAlgorithm algorithm) { for(ScopeAndMetricOnlySchemaRecord record : records) { String id = null; String scopeAndMetricName = ScopeAndMetricOnlySchemaRecord.getFieldsAsString(record); if(HashAlgorithm.MD5.equals(algorithm)) { id = DigestUtils.md5Hex(scopeAndMetricName); } else { id = String.valueOf(LongHashFunction.xx().hashChars(scopeAndMetricName)); } _idToSchemaRecordMap.put(id, record); } }
public ScopeOnlySchemaRecordList(List<ScopeOnlySchemaRecord> records, HashAlgorithm algorithm) { for(ScopeOnlySchemaRecord record : records) { String id = null; String scopeOnly = record.getScope(); if(HashAlgorithm.MD5.equals(algorithm)) { id = DigestUtils.md5Hex(scopeOnly); } else { id = String.valueOf(LongHashFunction.xx().hashChars(scopeOnly)); } _idToSchemaRecordMap.put(id, record); } }
public ScopeOnlySchemaRecordList(List<ScopeOnlySchemaRecord> records, HashAlgorithm algorithm) { for(ScopeOnlySchemaRecord record : records) { String id = null; String scopeOnly = record.getScope(); if(HashAlgorithm.MD5.equals(algorithm)) { id = DigestUtils.md5Hex(scopeOnly); } else { id = String.valueOf(LongHashFunction.xx().hashChars(scopeOnly)); } _idToSchemaRecordMap.put(id, record); } }
public ScopeAndMetricOnlySchemaRecordList(List<ScopeAndMetricOnlySchemaRecord> records, HashAlgorithm algorithm) { for(ScopeAndMetricOnlySchemaRecord record : records) { String id = null; String scopeAndMetricName = ScopeAndMetricOnlySchemaRecord.getFieldsAsString(record); if(HashAlgorithm.MD5.equals(algorithm)) { id = DigestUtils.md5Hex(scopeAndMetricName); } else { id = String.valueOf(LongHashFunction.xx().hashChars(scopeAndMetricName)); } _idToSchemaRecordMap.put(id, record); } }
public MetatagsSchemaRecordList(List<MetatagsRecord> records, HashAlgorithm algorithm) { for(MetatagsRecord record : records) { String id = null; if(HashAlgorithm.MD5.equals(algorithm)) { id = DigestUtils.md5Hex(record.getKey()); } else { id = String.valueOf(LongHashFunction.xx().hashChars(record.getKey())); } _idToSchemaRecordMap.put(id, record); } }
public MetatagsSchemaRecordList(List<MetatagsRecord> records, HashAlgorithm algorithm) { for(MetatagsRecord record : records) { String id = null; if(HashAlgorithm.MD5.equals(algorithm)) { id = DigestUtils.md5Hex(record.getKey()); } else { id = String.valueOf(LongHashFunction.xx().hashChars(record.getKey())); } _idToSchemaRecordMap.put(id, record); } }
public MetricSchemaRecordList(List<MetricSchemaRecord> records, HashAlgorithm algorithm) { for(MetricSchemaRecord record : records) { String id = null; if(HashAlgorithm.MD5.equals(algorithm)) { id = DigestUtils.md5Hex(MetricSchemaRecord.print(record)); } else { id = String.valueOf(LongHashFunction.xx().hashChars(MetricSchemaRecord.print(record))); } _idToSchemaRecordMap.put(id, record); } }
public MetricSchemaRecordList(List<MetricSchemaRecord> records, HashAlgorithm algorithm) { for(MetricSchemaRecord record : records) { String id = null; if(HashAlgorithm.MD5.equals(algorithm)) { id = DigestUtils.md5Hex(MetricSchemaRecord.print(record)); } else { id = String.valueOf(LongHashFunction.xx().hashChars(MetricSchemaRecord.print(record))); } _idToSchemaRecordMap.put(id, record); } }
ByteBuf b = Unpooled.buffer(); serialize(o, b); hash = LongHashFunction.xx().hashBytes(b.nioBuffer()); b.release(); return Utils.longToBigEndianByteArray(hash);
public void createBits(IColumn column, IMembershipSet memSet) { final IRowIterator myIter = memSet.getIterator(); LongHashFunction hash = LongHashFunction.xx(this.seed); int currRow = myIter.getNextRow(); int cardinality = 0; while ((currRow >= 0) && (cardinality < bitThreshold)) { // if threshold reached stop iterating if (!column.isMissing(currRow)) { long itemHash = column.hashCode64(currRow, hash); int index = (int) itemHash >>> (Long.SIZE - this.logSize); if (!bits.get(index)) cardinality++; this.bits.set(index); } currRow = myIter.getNextRow(); } }
/** * Creates a Hyperloglog data structure from a column and membership set. Uses the hash code * of the objects in the column as identifier. */ public void createHLL(IColumn column, IMembershipSet memSet) { final IRowIterator myIter = memSet.getIterator(); LongHashFunction hash = LongHashFunction.xx(this.seed); int currRow = myIter.getNextRow(); while (currRow >= 0) { if (!column.isMissing(currRow)) { this.add(column.hashCode64(currRow, hash)); } currRow = myIter.getNextRow(); } this.distinctItemsEstimator(); }
throw new IllegalArgumentException( "SampleDistinctElementsSketch only supports String-like columns"); LongHashFunction hash = LongHashFunction.xx(this.seed); @Nullable String minString = null; @Nullable String maxString = null;
VirtualRowSnapshot vw = new VirtualRowSnapshot(data, schema); MinKRows mkRows = new MinKRows(numSamples); LongHashFunction hash = LongHashFunction.xx(this.seed); IRowIterator rowIt = data.getRowIterator(); int currRow = rowIt.getNextRow();