id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
54,800
auth0/auth0-java
src/main/java/com/auth0/client/auth/LogoutUrlBuilder.java
LogoutUrlBuilder.build
public String build() { for (Map.Entry<String, String> p : parameters.entrySet()) { builder.addQueryParameter(p.getKey(), p.getValue()); } return builder.build().toString(); }
java
public String build() { for (Map.Entry<String, String> p : parameters.entrySet()) { builder.addQueryParameter(p.getKey(), p.getValue()); } return builder.build().toString(); }
[ "public", "String", "build", "(", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "String", ">", "p", ":", "parameters", ".", "entrySet", "(", ")", ")", "{", "builder", ".", "addQueryParameter", "(", "p", ".", "getKey", "(", ")", ","...
Creates a string representation of the URL with the configured parameters. @return the string URL
[ "Creates", "a", "string", "representation", "of", "the", "URL", "with", "the", "configured", "parameters", "." ]
b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c
https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/auth/LogoutUrlBuilder.java#L67-L72
54,801
auth0/auth0-java
src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java
Enrollment.getEnrolledAt
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") @JsonProperty("enrolled_at") public Date getEnrolledAt() { return enrolledAt; }
java
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") @JsonProperty("enrolled_at") public Date getEnrolledAt() { return enrolledAt; }
[ "@", "JsonFormat", "(", "shape", "=", "JsonFormat", ".", "Shape", ".", "STRING", ",", "pattern", "=", "\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"", ")", "@", "JsonProperty", "(", "\"enrolled_at\"", ")", "public", "Date", "getEnrolledAt", "(", ")", "{", "return", "enrolled...
Getter for the enrolled at. @return the enrolled at.
[ "Getter", "for", "the", "enrolled", "at", "." ]
b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c
https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java#L114-L118
54,802
auth0/auth0-java
src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java
Enrollment.getLastAuth
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") @JsonProperty("last_auth") public Date getLastAuth() { return lastAuth; }
java
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") @JsonProperty("last_auth") public Date getLastAuth() { return lastAuth; }
[ "@", "JsonFormat", "(", "shape", "=", "JsonFormat", ".", "Shape", ".", "STRING", ",", "pattern", "=", "\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"", ")", "@", "JsonProperty", "(", "\"last_auth\"", ")", "public", "Date", "getLastAuth", "(", ")", "{", "return", "lastAuth", ...
Getter for the last authentication. @return the last authentication.
[ "Getter", "for", "the", "last", "authentication", "." ]
b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c
https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/json/mgmt/guardian/Enrollment.java#L125-L129
54,803
auth0/auth0-java
src/main/java/com/auth0/client/auth/AuthorizeUrlBuilder.java
AuthorizeUrlBuilder.withParameter
public AuthorizeUrlBuilder withParameter(String name, String value) { assertNotNull(name, "name"); assertNotNull(value, "value"); parameters.put(name, value); return this; }
java
public AuthorizeUrlBuilder withParameter(String name, String value) { assertNotNull(name, "name"); assertNotNull(value, "value"); parameters.put(name, value); return this; }
[ "public", "AuthorizeUrlBuilder", "withParameter", "(", "String", "name", ",", "String", "value", ")", "{", "assertNotNull", "(", "name", ",", "\"name\"", ")", ";", "assertNotNull", "(", "value", ",", "\"value\"", ")", ";", "parameters", ".", "put", "(", "nam...
Sets an additional parameter. @param name name of the parameter @param value value of the parameter to set @return the builder instance
[ "Sets", "an", "additional", "parameter", "." ]
b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c
https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/auth/AuthorizeUrlBuilder.java#L111-L116
54,804
auth0/auth0-java
src/main/java/com/auth0/exception/APIException.java
APIException.getValue
public Object getValue(String key) { if (values == null) { return null; } return values.get(key); }
java
public Object getValue(String key) { if (values == null) { return null; } return values.get(key); }
[ "public", "Object", "getValue", "(", "String", "key", ")", "{", "if", "(", "values", "==", "null", ")", "{", "return", "null", ";", "}", "return", "values", ".", "get", "(", "key", ")", ";", "}" ]
Returns a value from the error map, if any. @param key key of the value to return @return the value if found or null
[ "Returns", "a", "value", "from", "the", "error", "map", "if", "any", "." ]
b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c
https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/exception/APIException.java#L67-L72
54,805
auth0/auth0-java
src/main/java/com/auth0/json/mgmt/DailyStats.java
DailyStats.getDate
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") @JsonProperty("date") public Date getDate() { return date; }
java
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") @JsonProperty("date") public Date getDate() { return date; }
[ "@", "JsonFormat", "(", "shape", "=", "JsonFormat", ".", "Shape", ".", "STRING", ",", "pattern", "=", "\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"", ")", "@", "JsonProperty", "(", "\"date\"", ")", "public", "Date", "getDate", "(", ")", "{", "return", "date", ";", "}" ]
Getter for the date to which the stats belong @return the date to which the stats belong
[ "Getter", "for", "the", "date", "to", "which", "the", "stats", "belong" ]
b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c
https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/json/mgmt/DailyStats.java#L39-L43
54,806
auth0/auth0-java
src/main/java/com/auth0/client/mgmt/filter/LogEventFilter.java
LogEventFilter.withCheckpoint
public LogEventFilter withCheckpoint(String from, int take) { parameters.put("from", from); parameters.put("take", take); return this; }
java
public LogEventFilter withCheckpoint(String from, int take) { parameters.put("from", from); parameters.put("take", take); return this; }
[ "public", "LogEventFilter", "withCheckpoint", "(", "String", "from", ",", "int", "take", ")", "{", "parameters", ".", "put", "(", "\"from\"", ",", "from", ")", ";", "parameters", ".", "put", "(", "\"take\"", ",", "take", ")", ";", "return", "this", ";", ...
Filter by checkpoint @param from the log event id to start retrieving logs from. @param take the limit of items to retrieve. @return this filter instance
[ "Filter", "by", "checkpoint" ]
b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c
https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/mgmt/filter/LogEventFilter.java#L15-L19
54,807
lucidworks/spark-solr
src/main/java/com/lucidworks/spark/example/streaming/TwitterToSolrStreamProcessor.java
TwitterToSolrStreamProcessor.setup
@Override public void setup(JavaStreamingContext jssc, CommandLine cli) throws Exception { String filtersArg = cli.getOptionValue("tweetFilters"); String[] filters = (filtersArg != null) ? filtersArg.split(",") : new String[0]; // start receiving a stream of tweets ... JavaReceiverInputDStream<Status...
java
@Override public void setup(JavaStreamingContext jssc, CommandLine cli) throws Exception { String filtersArg = cli.getOptionValue("tweetFilters"); String[] filters = (filtersArg != null) ? filtersArg.split(",") : new String[0]; // start receiving a stream of tweets ... JavaReceiverInputDStream<Status...
[ "@", "Override", "public", "void", "setup", "(", "JavaStreamingContext", "jssc", ",", "CommandLine", "cli", ")", "throws", "Exception", "{", "String", "filtersArg", "=", "cli", ".", "getOptionValue", "(", "\"tweetFilters\"", ")", ";", "String", "[", "]", "filt...
Sends a stream of tweets to Solr.
[ "Sends", "a", "stream", "of", "tweets", "to", "Solr", "." ]
8ff1b3cdd99041be6070077c18ec9c1cd7257cc3
https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/example/streaming/TwitterToSolrStreamProcessor.java#L30-L74
54,808
lucidworks/spark-solr
src/main/java/com/lucidworks/spark/SparkApp.java
SparkApp.main
public static void main(String[] args) throws Exception { if (args == null || args.length == 0 || args[0] == null || args[0].trim().length() == 0) { System.err.println("Invalid command-line args! Must pass the name of a processor to run.\n" + "Supported processors:\n"); displayProcessorOptions...
java
public static void main(String[] args) throws Exception { if (args == null || args.length == 0 || args[0] == null || args[0].trim().length() == 0) { System.err.println("Invalid command-line args! Must pass the name of a processor to run.\n" + "Supported processors:\n"); displayProcessorOptions...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "if", "(", "args", "==", "null", "||", "args", ".", "length", "==", "0", "||", "args", "[", "0", "]", "==", "null", "||", "args", "[", "0", "]",...
Runs a stream processor implementation.
[ "Runs", "a", "stream", "processor", "implementation", "." ]
8ff1b3cdd99041be6070077c18ec9c1cd7257cc3
https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/SparkApp.java#L118-L164
54,809
lucidworks/spark-solr
src/main/java/com/lucidworks/spark/SparkApp.java
SparkApp.getCommonOptions
public static Option[] getCommonOptions() { return new Option[] { Option.builder() .hasArg() .required(false) .desc("Batch interval (seconds) for streaming applications; default is 1 second") .longOpt("batchInterval") .build(), Option...
java
public static Option[] getCommonOptions() { return new Option[] { Option.builder() .hasArg() .required(false) .desc("Batch interval (seconds) for streaming applications; default is 1 second") .longOpt("batchInterval") .build(), Option...
[ "public", "static", "Option", "[", "]", "getCommonOptions", "(", ")", "{", "return", "new", "Option", "[", "]", "{", "Option", ".", "builder", "(", ")", ".", "hasArg", "(", ")", ".", "required", "(", "false", ")", ".", "desc", "(", "\"Batch interval (s...
Support options common to all tools.
[ "Support", "options", "common", "to", "all", "tools", "." ]
8ff1b3cdd99041be6070077c18ec9c1cd7257cc3
https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/SparkApp.java#L192-L237
54,810
lucidworks/spark-solr
src/main/java/com/lucidworks/spark/SparkApp.java
SparkApp.newProcessor
private static RDDProcessor newProcessor(String streamProcType) throws Exception { streamProcType = streamProcType.trim(); if ("twitter-to-solr".equals(streamProcType)) return new TwitterToSolrStreamProcessor(); else if ("word-count".equals(streamProcType)) return new WordCount(); else if ...
java
private static RDDProcessor newProcessor(String streamProcType) throws Exception { streamProcType = streamProcType.trim(); if ("twitter-to-solr".equals(streamProcType)) return new TwitterToSolrStreamProcessor(); else if ("word-count".equals(streamProcType)) return new WordCount(); else if ...
[ "private", "static", "RDDProcessor", "newProcessor", "(", "String", "streamProcType", ")", "throws", "Exception", "{", "streamProcType", "=", "streamProcType", ".", "trim", "(", ")", ";", "if", "(", "\"twitter-to-solr\"", ".", "equals", "(", "streamProcType", ")",...
Creates an instance of the requested tool, using classpath scanning if necessary
[ "Creates", "an", "instance", "of", "the", "requested", "tool", "using", "classpath", "scanning", "if", "necessary" ]
8ff1b3cdd99041be6070077c18ec9c1cd7257cc3
https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/SparkApp.java#L240-L277
54,811
lucidworks/spark-solr
src/main/java/com/lucidworks/spark/SparkApp.java
SparkApp.processCommandLineArgs
public static CommandLine processCommandLineArgs(Option[] customOptions, String[] args) { Options options = new Options(); options.addOption("h", "help", false, "Print this message"); options.addOption("v", "verbose", false, "Generate verbose log messages"); if (customOptions != null) { for (int...
java
public static CommandLine processCommandLineArgs(Option[] customOptions, String[] args) { Options options = new Options(); options.addOption("h", "help", false, "Print this message"); options.addOption("v", "verbose", false, "Generate verbose log messages"); if (customOptions != null) { for (int...
[ "public", "static", "CommandLine", "processCommandLineArgs", "(", "Option", "[", "]", "customOptions", ",", "String", "[", "]", "args", ")", "{", "Options", "options", "=", "new", "Options", "(", ")", ";", "options", ".", "addOption", "(", "\"h\"", ",", "\...
Parses the command-line arguments passed by the user.
[ "Parses", "the", "command", "-", "line", "arguments", "passed", "by", "the", "user", "." ]
8ff1b3cdd99041be6070077c18ec9c1cd7257cc3
https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/SparkApp.java#L331-L370
54,812
lucidworks/spark-solr
src/main/java/com/lucidworks/spark/SparkApp.java
SparkApp.findProcessorClassesInPackage
@SuppressWarnings("unchecked") private static List<Class<RDDProcessor>> findProcessorClassesInPackage(String packageName) { List<Class<RDDProcessor>> streamProcClasses = new ArrayList<Class<RDDProcessor>>(); try { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); String pat...
java
@SuppressWarnings("unchecked") private static List<Class<RDDProcessor>> findProcessorClassesInPackage(String packageName) { List<Class<RDDProcessor>> streamProcClasses = new ArrayList<Class<RDDProcessor>>(); try { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); String pat...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "List", "<", "Class", "<", "RDDProcessor", ">", ">", "findProcessorClassesInPackage", "(", "String", "packageName", ")", "{", "List", "<", "Class", "<", "RDDProcessor", ">>", "streamProcClass...
Scans Jar files on the classpath for RDDProcessor implementations to activate.
[ "Scans", "Jar", "files", "on", "the", "classpath", "for", "RDDProcessor", "implementations", "to", "activate", "." ]
8ff1b3cdd99041be6070077c18ec9c1cd7257cc3
https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/SparkApp.java#L375-L397
54,813
lucidworks/spark-solr
src/main/java/com/lucidworks/spark/query/sql/SolrSQLSupport.java
SolrSQLSupport.parseColumns
public static Map<String,String> parseColumns(String sqlStmt) throws Exception { // NOTE: While I prefer using a SQL parser here, the presto / calcite / Spark parsers were too complex // for this basic task and pulled in unwanted / incompatible dependencies, e.g. presto requires a different // version of g...
java
public static Map<String,String> parseColumns(String sqlStmt) throws Exception { // NOTE: While I prefer using a SQL parser here, the presto / calcite / Spark parsers were too complex // for this basic task and pulled in unwanted / incompatible dependencies, e.g. presto requires a different // version of g...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "parseColumns", "(", "String", "sqlStmt", ")", "throws", "Exception", "{", "// NOTE: While I prefer using a SQL parser here, the presto / calcite / Spark parsers were too complex", "// for this basic task and pulled in u...
Given a valid Solr SQL statement, parse out the columns and aliases as a map.
[ "Given", "a", "valid", "Solr", "SQL", "statement", "parse", "out", "the", "columns", "and", "aliases", "as", "a", "map", "." ]
8ff1b3cdd99041be6070077c18ec9c1cd7257cc3
https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/query/sql/SolrSQLSupport.java#L20-L68
54,814
lucidworks/spark-solr
src/main/java/com/lucidworks/spark/query/SolrTermVector.java
SolrTermVector.newInstance
public static SolrTermVector newInstance(String docId, HashingTF hashingTF, NamedList<Object> termList) { int termCount = termList.size(); int[] indices = new int[termCount]; double[] weights = new double[termCount]; String[] terms = new String[termCount]; Iterator<Map.Entry<String,Object>> termsIt...
java
public static SolrTermVector newInstance(String docId, HashingTF hashingTF, NamedList<Object> termList) { int termCount = termList.size(); int[] indices = new int[termCount]; double[] weights = new double[termCount]; String[] terms = new String[termCount]; Iterator<Map.Entry<String,Object>> termsIt...
[ "public", "static", "SolrTermVector", "newInstance", "(", "String", "docId", ",", "HashingTF", "hashingTF", ",", "NamedList", "<", "Object", ">", "termList", ")", "{", "int", "termCount", "=", "termList", ".", "size", "(", ")", ";", "int", "[", "]", "indic...
Converts doc-level term vector information the Solr QueryResponse into a SolrTermVector.
[ "Converts", "doc", "-", "level", "term", "vector", "information", "the", "Solr", "QueryResponse", "into", "a", "SolrTermVector", "." ]
8ff1b3cdd99041be6070077c18ec9c1cd7257cc3
https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/query/SolrTermVector.java#L31-L58
54,815
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForCRUDInsert.java
AbstractOptionsForCRUDInsert.getOverridenStrategy
public InsertStrategy getOverridenStrategy(AbstractEntityProperty<?> property) { final InsertStrategy insertStrategy = OverridingOptional .from(this.insertStrategy) .defaultValue(property.insertStrategy()) .get(); if (LOGGER.isTraceEnabled()) { ...
java
public InsertStrategy getOverridenStrategy(AbstractEntityProperty<?> property) { final InsertStrategy insertStrategy = OverridingOptional .from(this.insertStrategy) .defaultValue(property.insertStrategy()) .get(); if (LOGGER.isTraceEnabled()) { ...
[ "public", "InsertStrategy", "getOverridenStrategy", "(", "AbstractEntityProperty", "<", "?", ">", "property", ")", "{", "final", "InsertStrategy", "insertStrategy", "=", "OverridingOptional", ".", "from", "(", "this", ".", "insertStrategy", ")", ".", "defaultValue", ...
Determine the insert strategy for the given entity using static configuration and runtime option @param property entity property @return overriden InsertStrategy
[ "Determine", "the", "insert", "strategy", "for", "the", "given", "entity", "using", "static", "configuration", "and", "runtime", "option" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForCRUDInsert.java#L137-L150
54,816
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/codegen/dsl/delete/cassandra3_0/DeleteWhereDSLCodeGen3_0.java
DeleteWhereDSLCodeGen3_0.buildDeleteWhereForClusteringColumn
@Override public TypeSpec buildDeleteWhereForClusteringColumn(EntityMetaSignature signature, List<FieldSignatureInfo> clusteringCols, List<ClassSignatureInfo> classesSignature, ...
java
@Override public TypeSpec buildDeleteWhereForClusteringColumn(EntityMetaSignature signature, List<FieldSignatureInfo> clusteringCols, List<ClassSignatureInfo> classesSignature, ...
[ "@", "Override", "public", "TypeSpec", "buildDeleteWhereForClusteringColumn", "(", "EntityMetaSignature", "signature", ",", "List", "<", "FieldSignatureInfo", ">", "clusteringCols", ",", "List", "<", "ClassSignatureInfo", ">", "classesSignature", ",", "ClassSignatureInfo", ...
Generate extra method to extends the AbstractDeleteEnd class @param signature @param clusteringCols @param classesSignature @param lastSignature @return
[ "Generate", "extra", "method", "to", "extends", "the", "AbstractDeleteEnd", "class" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/codegen/dsl/delete/cassandra3_0/DeleteWhereDSLCodeGen3_0.java#L77-L119
54,817
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java
AbstractManagerFactoryBuilder.withDefaultReadConsistencyMap
public T withDefaultReadConsistencyMap(Map<String, ConsistencyLevel> readConsistencyMap) { configMap.put(CONSISTENCY_LEVEL_READ_MAP, readConsistencyMap); return getThis(); }
java
public T withDefaultReadConsistencyMap(Map<String, ConsistencyLevel> readConsistencyMap) { configMap.put(CONSISTENCY_LEVEL_READ_MAP, readConsistencyMap); return getThis(); }
[ "public", "T", "withDefaultReadConsistencyMap", "(", "Map", "<", "String", ",", "ConsistencyLevel", ">", "readConsistencyMap", ")", "{", "configMap", ".", "put", "(", "CONSISTENCY_LEVEL_READ_MAP", ",", "readConsistencyMap", ")", ";", "return", "getThis", "(", ")", ...
Define the default Consistency level map to be used for all READ operations The map keys represent table names and values represent the corresponding consistency level @return ManagerFactoryBuilder @see <a href="https://github.com/doanduyhai/Achilles/wiki/Configuration-Parameters#consistency-level" target="_blank">Con...
[ "Define", "the", "default", "Consistency", "level", "map", "to", "be", "used", "for", "all", "READ", "operations", "The", "map", "keys", "represent", "table", "names", "and", "values", "represent", "the", "corresponding", "consistency", "level" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L135-L138
54,818
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java
AbstractManagerFactoryBuilder.withDefaultWriteConsistencyMap
public T withDefaultWriteConsistencyMap(Map<String, ConsistencyLevel> writeConsistencyMap) { configMap.put(CONSISTENCY_LEVEL_WRITE_MAP, writeConsistencyMap); return getThis(); }
java
public T withDefaultWriteConsistencyMap(Map<String, ConsistencyLevel> writeConsistencyMap) { configMap.put(CONSISTENCY_LEVEL_WRITE_MAP, writeConsistencyMap); return getThis(); }
[ "public", "T", "withDefaultWriteConsistencyMap", "(", "Map", "<", "String", ",", "ConsistencyLevel", ">", "writeConsistencyMap", ")", "{", "configMap", ".", "put", "(", "CONSISTENCY_LEVEL_WRITE_MAP", ",", "writeConsistencyMap", ")", ";", "return", "getThis", "(", ")...
Define the default Consistency level map to be used for all WRITE operations The map keys represent table names and values represent the corresponding consistency level @return ManagerFactoryBuilder @see <a href="https://github.com/doanduyhai/Achilles/wiki/Configuration-Parameters#consistency-level" target="_blank">Co...
[ "Define", "the", "default", "Consistency", "level", "map", "to", "be", "used", "for", "all", "WRITE", "operations", "The", "map", "keys", "represent", "table", "names", "and", "values", "represent", "the", "corresponding", "consistency", "level" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L148-L151
54,819
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java
AbstractManagerFactoryBuilder.withDefaultSerialConsistencyMap
public T withDefaultSerialConsistencyMap(Map<String, ConsistencyLevel> serialConsistencyMap) { configMap.put(CONSISTENCY_LEVEL_SERIAL_MAP, serialConsistencyMap); return getThis(); }
java
public T withDefaultSerialConsistencyMap(Map<String, ConsistencyLevel> serialConsistencyMap) { configMap.put(CONSISTENCY_LEVEL_SERIAL_MAP, serialConsistencyMap); return getThis(); }
[ "public", "T", "withDefaultSerialConsistencyMap", "(", "Map", "<", "String", ",", "ConsistencyLevel", ">", "serialConsistencyMap", ")", "{", "configMap", ".", "put", "(", "CONSISTENCY_LEVEL_SERIAL_MAP", ",", "serialConsistencyMap", ")", ";", "return", "getThis", "(", ...
Define the default Consistency level map to be used for all LightWeightTransaction operations operations The map keys represent table names and values represent the corresponding consistency level @return ManagerFactoryBuilder @see <a href="https://github.com/doanduyhai/Achilles/wiki/Configuration-Parameters#consisten...
[ "Define", "the", "default", "Consistency", "level", "map", "to", "be", "used", "for", "all", "LightWeightTransaction", "operations", "operations", "The", "map", "keys", "represent", "table", "names", "and", "values", "represent", "the", "corresponding", "consistency...
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L161-L164
54,820
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java
AbstractManagerFactoryBuilder.withEventInterceptors
public T withEventInterceptors(List<Interceptor<?>> interceptors) { configMap.put(EVENT_INTERCEPTORS, interceptors); return getThis(); }
java
public T withEventInterceptors(List<Interceptor<?>> interceptors) { configMap.put(EVENT_INTERCEPTORS, interceptors); return getThis(); }
[ "public", "T", "withEventInterceptors", "(", "List", "<", "Interceptor", "<", "?", ">", ">", "interceptors", ")", "{", "configMap", ".", "put", "(", "EVENT_INTERCEPTORS", ",", "interceptors", ")", ";", "return", "getThis", "(", ")", ";", "}" ]
Provide a list of event interceptors @return ManagerFactoryBuilder @see <a href="https://github.com/doanduyhai/Achilles/wiki/Configuration-Parameters#events-interceptors" target="_blank">Event interceptors</a>
[ "Provide", "a", "list", "of", "event", "interceptors" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L222-L225
54,821
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java
AbstractManagerFactoryBuilder.withParameter
public T withParameter(ConfigurationParameters parameter, Object value) { configMap.put(parameter, value); return getThis(); }
java
public T withParameter(ConfigurationParameters parameter, Object value) { configMap.put(parameter, value); return getThis(); }
[ "public", "T", "withParameter", "(", "ConfigurationParameters", "parameter", ",", "Object", "value", ")", "{", "configMap", ".", "put", "(", "parameter", ",", "value", ")", ";", "return", "getThis", "(", ")", ";", "}" ]
Pass an arbitrary parameter to configure Achilles @param parameter an instance of the ConfigurationParameters enum @param value the value of the parameter @return ManagerFactoryBuilder
[ "Pass", "an", "arbitrary", "parameter", "to", "configure", "Achilles" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L471-L474
54,822
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/runtime/AbstractManager.java
AbstractManager.mapFromRow
public ENTITY mapFromRow(Row row) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(format("Map row %s back to entity of type %s", row, entityClass.getCanonicalName())); } validateNotNull(row, "Row object should not be null"); final String tableName = row.getColumnDefinitions()....
java
public ENTITY mapFromRow(Row row) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(format("Map row %s back to entity of type %s", row, entityClass.getCanonicalName())); } validateNotNull(row, "Row object should not be null"); final String tableName = row.getColumnDefinitions()....
[ "public", "ENTITY", "mapFromRow", "(", "Row", "row", ")", "{", "if", "(", "LOGGER", ".", "isDebugEnabled", "(", ")", ")", "{", "LOGGER", ".", "debug", "(", "format", "(", "\"Map row %s back to entity of type %s\"", ",", "row", ",", "entityClass", ".", "getCa...
Map a given row back to an entity instance. This method provides a raw object mapping facility. Advanced features like interceptors are not available. User codecs are taken into account though. @param row given Cassandra row @return entity instance
[ "Map", "a", "given", "row", "back", "to", "an", "entity", "instance", ".", "This", "method", "provides", "a", "raw", "object", "mapping", "facility", ".", "Advanced", "features", "like", "interceptors", "are", "not", "available", ".", "User", "codecs", "are"...
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/runtime/AbstractManager.java#L65-L77
54,823
doanduyhai/Achilles
achilles-embedded/src/main/java/info/archinnov/achilles/embedded/CassandraEmbeddedServerBuilder.java
CassandraEmbeddedServerBuilder.withScript
public CassandraEmbeddedServerBuilder withScript(String scriptLocation) { Validator.validateNotBlank(scriptLocation, "The script location should not be blank while executing CassandraEmbeddedServerBuilder.withScript()"); scriptLocations.add(scriptLocation.trim()); return this; }
java
public CassandraEmbeddedServerBuilder withScript(String scriptLocation) { Validator.validateNotBlank(scriptLocation, "The script location should not be blank while executing CassandraEmbeddedServerBuilder.withScript()"); scriptLocations.add(scriptLocation.trim()); return this; }
[ "public", "CassandraEmbeddedServerBuilder", "withScript", "(", "String", "scriptLocation", ")", "{", "Validator", ".", "validateNotBlank", "(", "scriptLocation", ",", "\"The script location should not be blank while executing CassandraEmbeddedServerBuilder.withScript()\"", ")", ";", ...
Load an CQL script in the class path and execute it upon initialization of the embedded Cassandra server <br/> Call this method as many times as there are CQL scripts to be executed. <br/> Example: <br/> <pre class="code"><code class="java"> CassandraEmbeddedServerBuilder .withScript("script1.cql") .withScript("scri...
[ "Load", "an", "CQL", "script", "in", "the", "class", "path", "and", "execute", "it", "upon", "initialization", "of", "the", "embedded", "Cassandra", "server" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-embedded/src/main/java/info/archinnov/achilles/embedded/CassandraEmbeddedServerBuilder.java#L429-L433
54,824
doanduyhai/Achilles
achilles-embedded/src/main/java/info/archinnov/achilles/embedded/CassandraEmbeddedServerBuilder.java
CassandraEmbeddedServerBuilder.withScriptTemplate
public CassandraEmbeddedServerBuilder withScriptTemplate(String scriptTemplateLocation, Map<String, Object> values) { Validator.validateNotBlank(scriptTemplateLocation, "The script template should not be blank while executing CassandraEmbeddedServerBuilder.withScriptTemplate()"); Validator.validateNotEm...
java
public CassandraEmbeddedServerBuilder withScriptTemplate(String scriptTemplateLocation, Map<String, Object> values) { Validator.validateNotBlank(scriptTemplateLocation, "The script template should not be blank while executing CassandraEmbeddedServerBuilder.withScriptTemplate()"); Validator.validateNotEm...
[ "public", "CassandraEmbeddedServerBuilder", "withScriptTemplate", "(", "String", "scriptTemplateLocation", ",", "Map", "<", "String", ",", "Object", ">", "values", ")", "{", "Validator", ".", "validateNotBlank", "(", "scriptTemplateLocation", ",", "\"The script template s...
Load an CQL script template in the class path, inject the values into the template to produce the final script and execute it upon initialization of the embedded Cassandra server <br/> Call this method as many times as there are CQL templates to be executed. <br/> Example: <br/> <pre class="code"><code class="java"> ...
[ "Load", "an", "CQL", "script", "template", "in", "the", "class", "path", "inject", "the", "values", "into", "the", "template", "to", "produce", "the", "final", "script", "and", "execute", "it", "upon", "initialization", "of", "the", "embedded", "Cassandra", ...
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-embedded/src/main/java/info/archinnov/achilles/embedded/CassandraEmbeddedServerBuilder.java#L465-L470
54,825
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/codegen/dsl/select/SelectWhereDSLCodeGen.java
SelectWhereDSLCodeGen.buildWhereClasses
public List<TypeSpec> buildWhereClasses(GlobalParsingContext context, EntityMetaSignature signature) { SelectWhereDSLCodeGen selectWhereDSLCodeGen = context.selectWhereDSLCodeGen(); final List<FieldSignatureInfo> partitionKeys = getPartitionKeysSignatureInfo(signature.fieldMetaSignatures); fina...
java
public List<TypeSpec> buildWhereClasses(GlobalParsingContext context, EntityMetaSignature signature) { SelectWhereDSLCodeGen selectWhereDSLCodeGen = context.selectWhereDSLCodeGen(); final List<FieldSignatureInfo> partitionKeys = getPartitionKeysSignatureInfo(signature.fieldMetaSignatures); fina...
[ "public", "List", "<", "TypeSpec", ">", "buildWhereClasses", "(", "GlobalParsingContext", "context", ",", "EntityMetaSignature", "signature", ")", "{", "SelectWhereDSLCodeGen", "selectWhereDSLCodeGen", "=", "context", ".", "selectWhereDSLCodeGen", "(", ")", ";", "final"...
ClassSignatureInfo lastSignature);
[ "ClassSignatureInfo", "lastSignature", ")", ";" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/codegen/dsl/select/SelectWhereDSLCodeGen.java#L61-L85
54,826
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java
AbstractOptionsForSelect.withConsistencyLevel
public T withConsistencyLevel(ConsistencyLevel consistencyLevel) { getOptions().setCl(Optional.of(consistencyLevel)); return getThis(); }
java
public T withConsistencyLevel(ConsistencyLevel consistencyLevel) { getOptions().setCl(Optional.of(consistencyLevel)); return getThis(); }
[ "public", "T", "withConsistencyLevel", "(", "ConsistencyLevel", "consistencyLevel", ")", "{", "getOptions", "(", ")", ".", "setCl", "(", "Optional", ".", "of", "(", "consistencyLevel", ")", ")", ";", "return", "getThis", "(", ")", ";", "}" ]
Set the given consistency level on the generated statement @throws NullPointerException if consistencyLevel is null
[ "Set", "the", "given", "consistency", "level", "on", "the", "generated", "statement" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L45-L48
54,827
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java
AbstractOptionsForSelect.withSerialConsistencyLevel
public T withSerialConsistencyLevel(ConsistencyLevel serialConsistencyLevel) { getOptions().setSerialCL(Optional.of(serialConsistencyLevel)); return getThis(); }
java
public T withSerialConsistencyLevel(ConsistencyLevel serialConsistencyLevel) { getOptions().setSerialCL(Optional.of(serialConsistencyLevel)); return getThis(); }
[ "public", "T", "withSerialConsistencyLevel", "(", "ConsistencyLevel", "serialConsistencyLevel", ")", "{", "getOptions", "(", ")", ".", "setSerialCL", "(", "Optional", ".", "of", "(", "serialConsistencyLevel", ")", ")", ";", "return", "getThis", "(", ")", ";", "}...
Set the given serial consistency level on the generated statement @throws NullPointerException if serialConsistencyLevel is null
[ "Set", "the", "given", "serial", "consistency", "level", "on", "the", "generated", "statement" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L62-L65
54,828
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java
AbstractOptionsForSelect.withOutgoingPayload
public T withOutgoingPayload(Map<String, ByteBuffer> outgoingPayload) { getOptions().setOutgoingPayLoad(Optional.of(outgoingPayload)); return getThis(); }
java
public T withOutgoingPayload(Map<String, ByteBuffer> outgoingPayload) { getOptions().setOutgoingPayLoad(Optional.of(outgoingPayload)); return getThis(); }
[ "public", "T", "withOutgoingPayload", "(", "Map", "<", "String", ",", "ByteBuffer", ">", "outgoingPayload", ")", "{", "getOptions", "(", ")", ".", "setOutgoingPayLoad", "(", "Optional", ".", "of", "(", "outgoingPayload", ")", ")", ";", "return", "getThis", "...
Set the given outgoing payload map on the generated statement @throws NullPointerException if outgoingPayload is null
[ "Set", "the", "given", "outgoing", "payload", "map", "on", "the", "generated", "statement" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L103-L106
54,829
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java
AbstractOptionsForSelect.withOptionalOutgoingPayload
public T withOptionalOutgoingPayload(Optional<Map<String, ByteBuffer>> outgoingPayload) { getOptions().setOutgoingPayLoad(outgoingPayload); return getThis(); }
java
public T withOptionalOutgoingPayload(Optional<Map<String, ByteBuffer>> outgoingPayload) { getOptions().setOutgoingPayLoad(outgoingPayload); return getThis(); }
[ "public", "T", "withOptionalOutgoingPayload", "(", "Optional", "<", "Map", "<", "String", ",", "ByteBuffer", ">", ">", "outgoingPayload", ")", "{", "getOptions", "(", ")", ".", "setOutgoingPayLoad", "(", "outgoingPayload", ")", ";", "return", "getThis", "(", "...
Set the given outgoing payload map on the generated statement IF NOT NULL
[ "Set", "the", "given", "outgoing", "payload", "map", "on", "the", "generated", "statement", "IF", "NOT", "NULL" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L111-L114
54,830
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java
AbstractOptionsForSelect.withPagingState
public T withPagingState(PagingState pagingState) { getOptions().setPagingState(Optional.of(pagingState)); return getThis(); }
java
public T withPagingState(PagingState pagingState) { getOptions().setPagingState(Optional.of(pagingState)); return getThis(); }
[ "public", "T", "withPagingState", "(", "PagingState", "pagingState", ")", "{", "getOptions", "(", ")", ".", "setPagingState", "(", "Optional", ".", "of", "(", "pagingState", ")", ")", ";", "return", "getThis", "(", ")", ";", "}" ]
Set the given paging state on the generated statement @throws NullPointerException if pagingState is null
[ "Set", "the", "given", "paging", "state", "on", "the", "generated", "statement" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L120-L123
54,831
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java
AbstractOptionsForSelect.withOptionalPagingStateString
public T withOptionalPagingStateString(Optional<String> pagingStateString) { pagingStateString.ifPresent(cl -> getOptions().setPagingState(Optional.of(PagingState.fromString(pagingStateString.get())))); return getThis(); }
java
public T withOptionalPagingStateString(Optional<String> pagingStateString) { pagingStateString.ifPresent(cl -> getOptions().setPagingState(Optional.of(PagingState.fromString(pagingStateString.get())))); return getThis(); }
[ "public", "T", "withOptionalPagingStateString", "(", "Optional", "<", "String", ">", "pagingStateString", ")", "{", "pagingStateString", ".", "ifPresent", "(", "cl", "->", "getOptions", "(", ")", ".", "setPagingState", "(", "Optional", ".", "of", "(", "PagingSta...
Set the given paging state string on the generated statement IF NOT NULL
[ "Set", "the", "given", "paging", "state", "string", "on", "the", "generated", "statement", "IF", "NOT", "NULL" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L147-L150
54,832
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java
AbstractOptionsForSelect.withRetryPolicy
public T withRetryPolicy(RetryPolicy retryPolicy) { getOptions().setRetryPolicy(Optional.of(retryPolicy)); return getThis(); }
java
public T withRetryPolicy(RetryPolicy retryPolicy) { getOptions().setRetryPolicy(Optional.of(retryPolicy)); return getThis(); }
[ "public", "T", "withRetryPolicy", "(", "RetryPolicy", "retryPolicy", ")", "{", "getOptions", "(", ")", ".", "setRetryPolicy", "(", "Optional", ".", "of", "(", "retryPolicy", ")", ")", ";", "return", "getThis", "(", ")", ";", "}" ]
Set the given retry policy @throws NullPointerException if value is null
[ "Set", "the", "given", "retry", "policy" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/options/AbstractOptionsForSelect.java#L156-L159
54,833
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/TypedQuery.java
TypedQuery.iterator
@Override public Iterator<ENTITY> iterator() { StatementWrapper statementWrapper = new BoundStatementWrapper(getOperationType(boundStatement), meta, boundStatement, encodedBoundValues); if (LOGGER.isTraceEnabled()) { LOGGER.trace(String.format("Generate iterator for typ...
java
@Override public Iterator<ENTITY> iterator() { StatementWrapper statementWrapper = new BoundStatementWrapper(getOperationType(boundStatement), meta, boundStatement, encodedBoundValues); if (LOGGER.isTraceEnabled()) { LOGGER.trace(String.format("Generate iterator for typ...
[ "@", "Override", "public", "Iterator", "<", "ENTITY", ">", "iterator", "(", ")", "{", "StatementWrapper", "statementWrapper", "=", "new", "BoundStatementWrapper", "(", "getOperationType", "(", "boundStatement", ")", ",", "meta", ",", "boundStatement", ",", "encode...
Execute the typed query and return an iterator of entities @return Iterator&lt;ENTITY&gt;
[ "Execute", "the", "typed", "query", "and", "return", "an", "iterator", "of", "entities" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/TypedQuery.java#L163-L176
54,834
doanduyhai/Achilles
achilles-common/src/main/java/info/archinnov/achilles/script/ScriptExecutor.java
ScriptExecutor.executeScriptTemplate
public void executeScriptTemplate(String scriptTemplateLocation, Map<String, Object> values) { final List<SimpleStatement> statements = buildStatements(loadScriptAsLines(scriptTemplateLocation, values)); for (SimpleStatement statement : statements) { if (isDMLStatement(statement)) { ...
java
public void executeScriptTemplate(String scriptTemplateLocation, Map<String, Object> values) { final List<SimpleStatement> statements = buildStatements(loadScriptAsLines(scriptTemplateLocation, values)); for (SimpleStatement statement : statements) { if (isDMLStatement(statement)) { ...
[ "public", "void", "executeScriptTemplate", "(", "String", "scriptTemplateLocation", ",", "Map", "<", "String", ",", "Object", ">", "values", ")", "{", "final", "List", "<", "SimpleStatement", ">", "statements", "=", "buildStatements", "(", "loadScriptAsLines", "("...
Execute a CQL script template located in the class path and inject provided values into the template to produce the actual script @param scriptTemplateLocation the location of the script template in the class path @param values template values
[ "Execute", "a", "CQL", "script", "template", "located", "in", "the", "class", "path", "and", "inject", "provided", "values", "into", "the", "template", "to", "produce", "the", "actual", "script" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-common/src/main/java/info/archinnov/achilles/script/ScriptExecutor.java#L86-L96
54,835
doanduyhai/Achilles
achilles-common/src/main/java/info/archinnov/achilles/script/ScriptExecutor.java
ScriptExecutor.executeAsync
public CompletableFuture<ResultSet> executeAsync(Statement statement) { return FutureUtils.toCompletableFuture(session.executeAsync(statement), sameThreadExecutor); }
java
public CompletableFuture<ResultSet> executeAsync(Statement statement) { return FutureUtils.toCompletableFuture(session.executeAsync(statement), sameThreadExecutor); }
[ "public", "CompletableFuture", "<", "ResultSet", ">", "executeAsync", "(", "Statement", "statement", ")", "{", "return", "FutureUtils", ".", "toCompletableFuture", "(", "session", ".", "executeAsync", "(", "statement", ")", ",", "sameThreadExecutor", ")", ";", "}"...
Execute a CQL statement asynchronously @param statement CQL statement @return CompletableFuture&lt;ResultSet&gt;
[ "Execute", "a", "CQL", "statement", "asynchronously" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-common/src/main/java/info/archinnov/achilles/script/ScriptExecutor.java#L138-L140
54,836
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java
AptUtils.getElementValuesWithDefaults
public static Map<ExecutableElement, AnnotationValue> getElementValuesWithDefaults(AnnotationMirror annotMirror) { Map<ExecutableElement, AnnotationValue> valMap = Optional .ofNullable((Map<ExecutableElement, AnnotationValue>)annotMirror.getElementValues()) .map(x -> new HashMap<...
java
public static Map<ExecutableElement, AnnotationValue> getElementValuesWithDefaults(AnnotationMirror annotMirror) { Map<ExecutableElement, AnnotationValue> valMap = Optional .ofNullable((Map<ExecutableElement, AnnotationValue>)annotMirror.getElementValues()) .map(x -> new HashMap<...
[ "public", "static", "Map", "<", "ExecutableElement", ",", "AnnotationValue", ">", "getElementValuesWithDefaults", "(", "AnnotationMirror", "annotMirror", ")", "{", "Map", "<", "ExecutableElement", ",", "AnnotationValue", ">", "valMap", "=", "Optional", ".", "ofNullabl...
Returns the values of an annotation's attributes, including defaults. The method with the same name in JavacElements cannot be used directly, because it includes a cast to Attribute.Compound, which doesn't hold for annotations generated by the Checker Framework. @param annotMirror annotation to examine @return the val...
[ "Returns", "the", "values", "of", "an", "annotation", "s", "attributes", "including", "defaults", ".", "The", "method", "with", "the", "same", "name", "in", "JavacElements", "cannot", "be", "used", "directly", "because", "it", "includes", "a", "cast", "to", ...
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java#L217-L230
54,837
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java
AptUtils.getElementValueClass
public static <T> Optional<Class<T>> getElementValueClass(AnnotationMirror anno, CharSequence name, boolean useDefaults) { Name cn = getElementValueClassName(anno, name, useDefaults); try { Class<?> cls = Class.forName(cn.toString...
java
public static <T> Optional<Class<T>> getElementValueClass(AnnotationMirror anno, CharSequence name, boolean useDefaults) { Name cn = getElementValueClassName(anno, name, useDefaults); try { Class<?> cls = Class.forName(cn.toString...
[ "public", "static", "<", "T", ">", "Optional", "<", "Class", "<", "T", ">", ">", "getElementValueClass", "(", "AnnotationMirror", "anno", ",", "CharSequence", "name", ",", "boolean", "useDefaults", ")", "{", "Name", "cn", "=", "getElementValueClassName", "(", ...
Get the Class that is referenced by attribute 'name'. This method uses Class.forName to load the class. It returns null if the class wasn't found.
[ "Get", "the", "Class", "that", "is", "referenced", "by", "attribute", "name", ".", "This", "method", "uses", "Class", ".", "forName", "to", "load", "the", "class", ".", "It", "returns", "null", "if", "the", "class", "wasn", "t", "found", "." ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java#L308-L317
54,838
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java
AptUtils.getElementValueEnum
public static <T extends Enum<T>> T getElementValueEnum(AnnotationMirror anno, CharSequence name, Class<T> t, boolean useDefaults) { Symbol.VarSymbol vs = getElementValue(anno, name, Symbol.VarSymbol.class, useDefaults); T value = Enum.valueOf(t, vs.getSimpleName().toString()); return value; ...
java
public static <T extends Enum<T>> T getElementValueEnum(AnnotationMirror anno, CharSequence name, Class<T> t, boolean useDefaults) { Symbol.VarSymbol vs = getElementValue(anno, name, Symbol.VarSymbol.class, useDefaults); T value = Enum.valueOf(t, vs.getSimpleName().toString()); return value; ...
[ "public", "static", "<", "T", "extends", "Enum", "<", "T", ">", ">", "T", "getElementValueEnum", "(", "AnnotationMirror", "anno", ",", "CharSequence", "name", ",", "Class", "<", "T", ">", "t", ",", "boolean", "useDefaults", ")", "{", "Symbol", ".", "VarS...
Version that is suitable for Enum elements.
[ "Version", "that", "is", "suitable", "for", "Enum", "elements", "." ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java#L322-L326
54,839
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java
AptUtils.enclosingClass
public static TypeElement enclosingClass(final Element elem) { Element result = elem; while (result != null && !result.getKind().isClass() && !result.getKind().isInterface()) { Element encl = result.getEnclosingElement(); result = encl; } return (T...
java
public static TypeElement enclosingClass(final Element elem) { Element result = elem; while (result != null && !result.getKind().isClass() && !result.getKind().isInterface()) { Element encl = result.getEnclosingElement(); result = encl; } return (T...
[ "public", "static", "TypeElement", "enclosingClass", "(", "final", "Element", "elem", ")", "{", "Element", "result", "=", "elem", ";", "while", "(", "result", "!=", "null", "&&", "!", "result", ".", "getKind", "(", ")", ".", "isClass", "(", ")", "&&", ...
Returns the innermost type element enclosing the given element @param elem the enclosed element of a class @return the innermost type element
[ "Returns", "the", "innermost", "type", "element", "enclosing", "the", "given", "element" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java#L334-L342
54,840
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java
AptUtils.findFieldInType
public static VariableElement findFieldInType(TypeElement type, String name) { for (VariableElement field : ElementFilter.fieldsIn(type.getEnclosedElements())) { if (field.getSimpleName().toString().equals(name)) { return field; } } return null; }
java
public static VariableElement findFieldInType(TypeElement type, String name) { for (VariableElement field : ElementFilter.fieldsIn(type.getEnclosedElements())) { if (field.getSimpleName().toString().equals(name)) { return field; } } return null; }
[ "public", "static", "VariableElement", "findFieldInType", "(", "TypeElement", "type", ",", "String", "name", ")", "{", "for", "(", "VariableElement", "field", ":", "ElementFilter", ".", "fieldsIn", "(", "type", ".", "getEnclosedElements", "(", ")", ")", ")", "...
Returns the field of the class
[ "Returns", "the", "field", "of", "the", "class" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java#L347-L354
54,841
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/NativeQuery.java
NativeQuery.executeAsyncWithStats
@Override public CompletableFuture<ExecutionInfo> executeAsyncWithStats() { final StatementWrapper statementWrapper = new NativeStatementWrapper(getOperationType(boundStatement), meta, boundStatement, encodedBoundValues); final String queryString = statementWrapper.getBoundStatement().preparedState...
java
@Override public CompletableFuture<ExecutionInfo> executeAsyncWithStats() { final StatementWrapper statementWrapper = new NativeStatementWrapper(getOperationType(boundStatement), meta, boundStatement, encodedBoundValues); final String queryString = statementWrapper.getBoundStatement().preparedState...
[ "@", "Override", "public", "CompletableFuture", "<", "ExecutionInfo", ">", "executeAsyncWithStats", "(", ")", "{", "final", "StatementWrapper", "statementWrapper", "=", "new", "NativeStatementWrapper", "(", "getOperationType", "(", "boundStatement", ")", ",", "meta", ...
Execute the native query asynchronously and return the execution info @return CompletableFuture&lt;ExecutionInfo&gt;
[ "Execute", "the", "native", "query", "asynchronously", "and", "return", "the", "execution", "info" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/NativeQuery.java#L170-L188
54,842
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java
AbstractProperty.decodeFromRaw
public VALUEFROM decodeFromRaw(Object o) { if (o == null && !isOptional()) return null; return decodeFromRawInternal(o); }
java
public VALUEFROM decodeFromRaw(Object o) { if (o == null && !isOptional()) return null; return decodeFromRawInternal(o); }
[ "public", "VALUEFROM", "decodeFromRaw", "(", "Object", "o", ")", "{", "if", "(", "o", "==", "null", "&&", "!", "isOptional", "(", ")", ")", "return", "null", ";", "return", "decodeFromRawInternal", "(", "o", ")", ";", "}" ]
Decode the given raw object to Java value value using Achilles codec system @param o @return
[ "Decode", "the", "given", "raw", "object", "to", "Java", "value", "value", "using", "Achilles", "codec", "system" ]
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java#L142-L145
54,843
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SetOperation.java
SetOperation.heapify
public static SetOperation heapify(final Memory srcMem, final long seed) { final byte famID = srcMem.getByte(FAMILY_BYTE); final Family family = idToFamily(famID); switch (family) { case UNION : { return UnionImpl.heapifyInstance(srcMem, seed); } case INTERSECTION : { retur...
java
public static SetOperation heapify(final Memory srcMem, final long seed) { final byte famID = srcMem.getByte(FAMILY_BYTE); final Family family = idToFamily(famID); switch (family) { case UNION : { return UnionImpl.heapifyInstance(srcMem, seed); } case INTERSECTION : { retur...
[ "public", "static", "SetOperation", "heapify", "(", "final", "Memory", "srcMem", ",", "final", "long", "seed", ")", "{", "final", "byte", "famID", "=", "srcMem", ".", "getByte", "(", "FAMILY_BYTE", ")", ";", "final", "Family", "family", "=", "idToFamily", ...
Heapify takes the SetOperation image in Memory and instantiates an on-heap SetOperation using the given seed. The resulting SetOperation will not retain any link to the source Memory. @param srcMem an image of a SetOperation where the hash of the given seed matches the image seed hash. <a href="{@docRoot}/resources/dic...
[ "Heapify", "takes", "the", "SetOperation", "image", "in", "Memory", "and", "instantiates", "an", "on", "-", "heap", "SetOperation", "using", "the", "given", "seed", ".", "The", "resulting", "SetOperation", "will", "not", "retain", "any", "link", "to", "the", ...
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L66-L81
54,844
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SetOperation.java
SetOperation.wrap
public static SetOperation wrap(final Memory srcMem, final long seed) { final byte famID = srcMem.getByte(FAMILY_BYTE); final Family family = idToFamily(famID); final int serVer = srcMem.getByte(SER_VER_BYTE); if (serVer != 3) { throw new SketchesArgumentException("SerVer must be 3: " + serVer); ...
java
public static SetOperation wrap(final Memory srcMem, final long seed) { final byte famID = srcMem.getByte(FAMILY_BYTE); final Family family = idToFamily(famID); final int serVer = srcMem.getByte(SER_VER_BYTE); if (serVer != 3) { throw new SketchesArgumentException("SerVer must be 3: " + serVer); ...
[ "public", "static", "SetOperation", "wrap", "(", "final", "Memory", "srcMem", ",", "final", "long", "seed", ")", "{", "final", "byte", "famID", "=", "srcMem", ".", "getByte", "(", "FAMILY_BYTE", ")", ";", "final", "Family", "family", "=", "idToFamily", "("...
Wrap takes the SetOperation image in Memory and refers to it directly. There is no data copying onto the java heap. Only "Direct" SetOperations that have been explicitly stored as direct can be wrapped. @param srcMem an image of a SetOperation where the hash of the given seed matches the image seed hash. <a href="{@doc...
[ "Wrap", "takes", "the", "SetOperation", "image", "in", "Memory", "and", "refers", "to", "it", "directly", ".", "There", "is", "no", "data", "copying", "onto", "the", "java", "heap", ".", "Only", "Direct", "SetOperations", "that", "have", "been", "explicitly"...
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L106-L123
54,845
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SetOperation.java
SetOperation.getMaxIntersectionBytes
public static int getMaxIntersectionBytes(final int nomEntries) { final int nomEnt = ceilingPowerOf2(nomEntries); final int bytes = (nomEnt << 4) + (Family.INTERSECTION.getMaxPreLongs() << 3); return bytes; }
java
public static int getMaxIntersectionBytes(final int nomEntries) { final int nomEnt = ceilingPowerOf2(nomEntries); final int bytes = (nomEnt << 4) + (Family.INTERSECTION.getMaxPreLongs() << 3); return bytes; }
[ "public", "static", "int", "getMaxIntersectionBytes", "(", "final", "int", "nomEntries", ")", "{", "final", "int", "nomEnt", "=", "ceilingPowerOf2", "(", "nomEntries", ")", ";", "final", "int", "bytes", "=", "(", "nomEnt", "<<", "4", ")", "+", "(", "Family...
Returns the maximum required storage bytes given a nomEntries parameter for Intersection operations @param nomEntries <a href="{@docRoot}/resources/dictionary.html#nomEntries">Nominal Entries</a> This will become the ceiling power of 2 if it is not. @return the maximum required storage bytes given a nomEntries paramete...
[ "Returns", "the", "maximum", "required", "storage", "bytes", "given", "a", "nomEntries", "parameter", "for", "Intersection", "operations" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L186-L190
54,846
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SetOperation.java
SetOperation.createCompactSketch
static final CompactSketch createCompactSketch(final long[] compactCache, boolean empty, final short seedHash, final int curCount, long thetaLong, final boolean dstOrdered, final WritableMemory dstMem) { thetaLong = thetaOnCompact(empty, curCount, thetaLong); empty = emptyOnCompact(curCount, thetaLo...
java
static final CompactSketch createCompactSketch(final long[] compactCache, boolean empty, final short seedHash, final int curCount, long thetaLong, final boolean dstOrdered, final WritableMemory dstMem) { thetaLong = thetaOnCompact(empty, curCount, thetaLong); empty = emptyOnCompact(curCount, thetaLo...
[ "static", "final", "CompactSketch", "createCompactSketch", "(", "final", "long", "[", "]", "compactCache", ",", "boolean", "empty", ",", "final", "short", "seedHash", ",", "final", "int", "curCount", ",", "long", "thetaLong", ",", "final", "boolean", "dstOrdered...
used only by the set operations
[ "used", "only", "by", "the", "set", "operations" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L227-L259
54,847
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SetOperation.java
SetOperation.computeMinLgArrLongsFromCount
static final int computeMinLgArrLongsFromCount(final int count) { final int upperCount = (int) Math.ceil(count / REBUILD_THRESHOLD); final int arrLongs = max(ceilingPowerOf2(upperCount), 1 << MIN_LG_ARR_LONGS); final int newLgArrLongs = Integer.numberOfTrailingZeros(arrLongs); return newLgArrLongs; }
java
static final int computeMinLgArrLongsFromCount(final int count) { final int upperCount = (int) Math.ceil(count / REBUILD_THRESHOLD); final int arrLongs = max(ceilingPowerOf2(upperCount), 1 << MIN_LG_ARR_LONGS); final int newLgArrLongs = Integer.numberOfTrailingZeros(arrLongs); return newLgArrLongs; }
[ "static", "final", "int", "computeMinLgArrLongsFromCount", "(", "final", "int", "count", ")", "{", "final", "int", "upperCount", "=", "(", "int", ")", "Math", ".", "ceil", "(", "count", "/", "REBUILD_THRESHOLD", ")", ";", "final", "int", "arrLongs", "=", "...
Used by intersection and AnotB
[ "Used", "by", "intersection", "and", "AnotB" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L267-L272
54,848
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SetOperation.java
SetOperation.isValidSetOpID
static boolean isValidSetOpID(final int id) { final Family family = Family.idToFamily(id); final boolean ret = ((family == Family.UNION) || (family == Family.INTERSECTION) || (family == Family.A_NOT_B)); return ret; }
java
static boolean isValidSetOpID(final int id) { final Family family = Family.idToFamily(id); final boolean ret = ((family == Family.UNION) || (family == Family.INTERSECTION) || (family == Family.A_NOT_B)); return ret; }
[ "static", "boolean", "isValidSetOpID", "(", "final", "int", "id", ")", "{", "final", "Family", "family", "=", "Family", ".", "idToFamily", "(", "id", ")", ";", "final", "boolean", "ret", "=", "(", "(", "family", "==", "Family", ".", "UNION", ")", "||",...
Returns true if given Family id is one of the set operations @param id the given Family id @return true if given Family id is one of the set operations
[ "Returns", "true", "if", "given", "Family", "id", "is", "one", "of", "the", "set", "operations" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperation.java#L279-L284
54,849
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/hll/AbstractHllArray.java
AbstractHllArray.hipAndKxQIncrementalUpdate
static final void hipAndKxQIncrementalUpdate(final AbstractHllArray host, final int oldValue, final int newValue) { assert newValue > oldValue; final int configK = 1 << host.getLgConfigK(); //update hipAccum BEFORE updating kxq0 and kxq1 double kxq0 = host.getKxQ0(); double kxq1 = host.getKxQ1...
java
static final void hipAndKxQIncrementalUpdate(final AbstractHllArray host, final int oldValue, final int newValue) { assert newValue > oldValue; final int configK = 1 << host.getLgConfigK(); //update hipAccum BEFORE updating kxq0 and kxq1 double kxq0 = host.getKxQ0(); double kxq1 = host.getKxQ1...
[ "static", "final", "void", "hipAndKxQIncrementalUpdate", "(", "final", "AbstractHllArray", "host", ",", "final", "int", "oldValue", ",", "final", "int", "newValue", ")", "{", "assert", "newValue", ">", "oldValue", ";", "final", "int", "configK", "=", "1", "<<"...
Called here and by Heap and Direct 6 and 8 bit implementations
[ "Called", "here", "and", "by", "Heap", "and", "Direct", "6", "and", "8", "bit", "implementations" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hll/AbstractHllArray.java#L161-L174
54,850
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java
SingleItemSketch.heapify
public static SingleItemSketch heapify(final Memory mem) { final long memPre0 = mem.getLong(0); checkDefaultBytes0to7(memPre0); return new SingleItemSketch(mem.getLong(8)); }
java
public static SingleItemSketch heapify(final Memory mem) { final long memPre0 = mem.getLong(0); checkDefaultBytes0to7(memPre0); return new SingleItemSketch(mem.getLong(8)); }
[ "public", "static", "SingleItemSketch", "heapify", "(", "final", "Memory", "mem", ")", "{", "final", "long", "memPre0", "=", "mem", ".", "getLong", "(", "0", ")", ";", "checkDefaultBytes0to7", "(", "memPre0", ")", ";", "return", "new", "SingleItemSketch", "(...
Creates a SingleItemSketch on the heap given a Memory and assumes the DEFAULT_UPDATE_SEED. @param mem the Memory to be heapified. It must be a least 16 bytes. @return a SingleItemSketch
[ "Creates", "a", "SingleItemSketch", "on", "the", "heap", "given", "a", "Memory", "and", "assumes", "the", "DEFAULT_UPDATE_SEED", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java#L55-L59
54,851
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java
SingleItemSketch.heapify
public static SingleItemSketch heapify(final Memory mem, final long seed) { final long memPre0 = mem.getLong(0); checkDefaultBytes0to5(memPre0); final short seedHashIn = mem.getShort(6); final short seedHashCk = computeSeedHash(seed); checkSeedHashes(seedHashIn, seedHashCk); return new SingleIte...
java
public static SingleItemSketch heapify(final Memory mem, final long seed) { final long memPre0 = mem.getLong(0); checkDefaultBytes0to5(memPre0); final short seedHashIn = mem.getShort(6); final short seedHashCk = computeSeedHash(seed); checkSeedHashes(seedHashIn, seedHashCk); return new SingleIte...
[ "public", "static", "SingleItemSketch", "heapify", "(", "final", "Memory", "mem", ",", "final", "long", "seed", ")", "{", "final", "long", "memPre0", "=", "mem", ".", "getLong", "(", "0", ")", ";", "checkDefaultBytes0to5", "(", "memPre0", ")", ";", "final"...
Creates a SingleItemSketch on the heap given a Memory. Checks the seed hash of the given Memory against a hash of the given seed. @param mem the Memory to be heapified @param seed a given hash seed @return a SingleItemSketch
[ "Creates", "a", "SingleItemSketch", "on", "the", "heap", "given", "a", "Memory", ".", "Checks", "the", "seed", "hash", "of", "the", "given", "Memory", "against", "a", "hash", "of", "the", "given", "seed", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java#L68-L75
54,852
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java
SingleItemSketch.create
public static SingleItemSketch create(final byte[] data) { if ((data == null) || (data.length == 0)) { return null; } return new SingleItemSketch(hash(data, DEFAULT_UPDATE_SEED)[0] >>> 1); }
java
public static SingleItemSketch create(final byte[] data) { if ((data == null) || (data.length == 0)) { return null; } return new SingleItemSketch(hash(data, DEFAULT_UPDATE_SEED)[0] >>> 1); }
[ "public", "static", "SingleItemSketch", "create", "(", "final", "byte", "[", "]", "data", ")", "{", "if", "(", "(", "data", "==", "null", ")", "||", "(", "data", ".", "length", "==", "0", ")", ")", "{", "return", "null", ";", "}", "return", "new", ...
Create this sketch with the given byte array. If the byte array is null or empty no create attempt is made and the method returns null. @param data The given byte array. @return a SingleItemSketch or null
[ "Create", "this", "sketch", "with", "the", "given", "byte", "array", ".", "If", "the", "byte", "array", "is", "null", "or", "empty", "no", "create", "attempt", "is", "made", "and", "the", "method", "returns", "null", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java#L131-L134
54,853
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java
SingleItemSketch.create
public static SingleItemSketch create(final long datum, final long seed) { final long[] data = { datum }; return new SingleItemSketch(hash(data, seed)[0] >>> 1); }
java
public static SingleItemSketch create(final long datum, final long seed) { final long[] data = { datum }; return new SingleItemSketch(hash(data, seed)[0] >>> 1); }
[ "public", "static", "SingleItemSketch", "create", "(", "final", "long", "datum", ",", "final", "long", "seed", ")", "{", "final", "long", "[", "]", "data", "=", "{", "datum", "}", ";", "return", "new", "SingleItemSketch", "(", "hash", "(", "data", ",", ...
Create this sketch with a long and a seed. @param datum The given long datum. @param seed used to hash the given value. @return a SingleItemSketch
[ "Create", "this", "sketch", "with", "a", "long", "and", "a", "seed", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java#L184-L187
54,854
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java
SingleItemSketch.create
public static SingleItemSketch create(final String datum, final long seed) { if ((datum == null) || datum.isEmpty()) { return null; } final byte[] data = datum.getBytes(UTF_8); return new SingleItemSketch(hash(data, seed)[0] >>> 1, seed); }
java
public static SingleItemSketch create(final String datum, final long seed) { if ((datum == null) || datum.isEmpty()) { return null; } final byte[] data = datum.getBytes(UTF_8); return new SingleItemSketch(hash(data, seed)[0] >>> 1, seed); }
[ "public", "static", "SingleItemSketch", "create", "(", "final", "String", "datum", ",", "final", "long", "seed", ")", "{", "if", "(", "(", "datum", "==", "null", ")", "||", "datum", ".", "isEmpty", "(", ")", ")", "{", "return", "null", ";", "}", "fin...
Create this sketch with the given String and a seed. The string is converted to a byte array using UTF8 encoding. If the string is null or empty no create attempt is made and the method returns null. <p>Note: this will not produce the same output hash values as the {@link #create(char[])} method and will generally be ...
[ "Create", "this", "sketch", "with", "the", "given", "String", "and", "a", "seed", ".", "The", "string", "is", "converted", "to", "a", "byte", "array", "using", "UTF8", "encoding", ".", "If", "the", "string", "is", "null", "or", "empty", "no", "create", ...
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java#L219-L223
54,855
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java
SingleItemSketch.create
public static SingleItemSketch create(final byte[] data, final long seed) { if ((data == null) || (data.length == 0)) { return null; } return new SingleItemSketch(hash(data, seed)[0] >>> 1, seed); }
java
public static SingleItemSketch create(final byte[] data, final long seed) { if ((data == null) || (data.length == 0)) { return null; } return new SingleItemSketch(hash(data, seed)[0] >>> 1, seed); }
[ "public", "static", "SingleItemSketch", "create", "(", "final", "byte", "[", "]", "data", ",", "final", "long", "seed", ")", "{", "if", "(", "(", "data", "==", "null", ")", "||", "(", "data", ".", "length", "==", "0", ")", ")", "{", "return", "null...
Create this sketch with the given byte array and a seed. If the byte array is null or empty no create attempt is made and the method returns null. @param data The given byte array. @param seed used to hash the given value. @return a SingleItemSketch or null
[ "Create", "this", "sketch", "with", "the", "given", "byte", "array", "and", "a", "seed", ".", "If", "the", "byte", "array", "is", "null", "or", "empty", "no", "create", "attempt", "is", "made", "and", "the", "method", "returns", "null", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java#L233-L236
54,856
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/tuple/QuickSelectSketch.java
QuickSelectSketch.reset
public void reset() { isEmpty_ = true; count_ = 0; theta_ = (long) (Long.MAX_VALUE * (double) samplingProbability_); final int startingCapacity = Util.getStartingCapacity(nomEntries_, lgResizeFactor_); lgCurrentCapacity_ = Integer.numberOfTrailingZeros(startingCapacity); keys_ = new long[startin...
java
public void reset() { isEmpty_ = true; count_ = 0; theta_ = (long) (Long.MAX_VALUE * (double) samplingProbability_); final int startingCapacity = Util.getStartingCapacity(nomEntries_, lgResizeFactor_); lgCurrentCapacity_ = Integer.numberOfTrailingZeros(startingCapacity); keys_ = new long[startin...
[ "public", "void", "reset", "(", ")", "{", "isEmpty_", "=", "true", ";", "count_", "=", "0", ";", "theta_", "=", "(", "long", ")", "(", "Long", ".", "MAX_VALUE", "*", "(", "double", ")", "samplingProbability_", ")", ";", "final", "int", "startingCapacit...
Resets this sketch an empty state.
[ "Resets", "this", "sketch", "an", "empty", "state", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/tuple/QuickSelectSketch.java#L239-L248
54,857
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/tuple/QuickSelectSketch.java
QuickSelectSketch.compact
@SuppressWarnings("unchecked") public CompactSketch<S> compact() { if (getRetainedEntries() == 0) { return new CompactSketch<>(null, null, theta_, isEmpty_); } final long[] keys = new long[getRetainedEntries()]; final S[] summaries = (S[]) Array.newInstance(summaries_.getClass().getCompone...
java
@SuppressWarnings("unchecked") public CompactSketch<S> compact() { if (getRetainedEntries() == 0) { return new CompactSketch<>(null, null, theta_, isEmpty_); } final long[] keys = new long[getRetainedEntries()]; final S[] summaries = (S[]) Array.newInstance(summaries_.getClass().getCompone...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "CompactSketch", "<", "S", ">", "compact", "(", ")", "{", "if", "(", "getRetainedEntries", "(", ")", "==", "0", ")", "{", "return", "new", "CompactSketch", "<>", "(", "null", ",", "null", ",",...
Converts the current state of the sketch into a compact sketch @return compact sketch
[ "Converts", "the", "current", "state", "of", "the", "sketch", "into", "a", "compact", "sketch" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/tuple/QuickSelectSketch.java#L254-L271
54,858
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/sampling/VarOptItemsUnion.java
VarOptItemsUnion.getResult
public VarOptItemsSketch<T> getResult() { // If no marked items in H, gadget is already valid mathematically. We can return what is // basically just a copy of the gadget. if (gadget_.getNumMarksInH() == 0) { return simpleGadgetCoercer(); } else { // At this point, we know that marked items ...
java
public VarOptItemsSketch<T> getResult() { // If no marked items in H, gadget is already valid mathematically. We can return what is // basically just a copy of the gadget. if (gadget_.getNumMarksInH() == 0) { return simpleGadgetCoercer(); } else { // At this point, we know that marked items ...
[ "public", "VarOptItemsSketch", "<", "T", ">", "getResult", "(", ")", "{", "// If no marked items in H, gadget is already valid mathematically. We can return what is", "// basically just a copy of the gadget.", "if", "(", "gadget_", ".", "getNumMarksInH", "(", ")", "==", "0", ...
Gets the varopt sketch resulting from the union of any input sketches. @return A varopt sketch
[ "Gets", "the", "varopt", "sketch", "resulting", "from", "the", "union", "of", "any", "input", "sketches", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/VarOptItemsUnion.java#L229-L247
54,859
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/sampling/VarOptItemsUnion.java
VarOptItemsUnion.markMovingGadgetCoercer
private VarOptItemsSketch<T> markMovingGadgetCoercer() { final int resultK = gadget_.getHRegionCount() + gadget_.getRRegionCount(); int resultH = 0; int resultR = 0; int nextRPos = resultK; // = (resultK+1)-1, to fill R region from back to front final ArrayList<T> data = new ArrayList<>(re...
java
private VarOptItemsSketch<T> markMovingGadgetCoercer() { final int resultK = gadget_.getHRegionCount() + gadget_.getRRegionCount(); int resultH = 0; int resultR = 0; int nextRPos = resultK; // = (resultK+1)-1, to fill R region from back to front final ArrayList<T> data = new ArrayList<>(re...
[ "private", "VarOptItemsSketch", "<", "T", ">", "markMovingGadgetCoercer", "(", ")", "{", "final", "int", "resultK", "=", "gadget_", ".", "getHRegionCount", "(", ")", "+", "gadget_", ".", "getRRegionCount", "(", ")", ";", "int", "resultH", "=", "0", ";", "i...
This coercer directly transfers marked items from the gadget's H into the result's R. Deciding whether that is a valid thing to do is the responsibility of the caller. Currently, this is only used for a subcase of pseudo-exact, but later it might be used by other subcases as well. @return A sketch derived from the gad...
[ "This", "coercer", "directly", "transfers", "marked", "items", "from", "the", "gadget", "s", "H", "into", "the", "result", "s", "R", ".", "Deciding", "whether", "that", "is", "a", "valid", "thing", "to", "do", "is", "the", "responsibility", "of", "the", ...
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/VarOptItemsUnion.java#L476-L538
54,860
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/CompactSketch.java
CompactSketch.compactCache
static final long[] compactCache(final long[] srcCache, final int curCount, final long thetaLong, final boolean dstOrdered) { if (curCount == 0) { return new long[0]; } final long[] cacheOut = new long[curCount]; final int len = srcCache.length; int j = 0; for (int i = 0; i < len; i+...
java
static final long[] compactCache(final long[] srcCache, final int curCount, final long thetaLong, final boolean dstOrdered) { if (curCount == 0) { return new long[0]; } final long[] cacheOut = new long[curCount]; final int len = srcCache.length; int j = 0; for (int i = 0; i < len; i+...
[ "static", "final", "long", "[", "]", "compactCache", "(", "final", "long", "[", "]", "srcCache", ",", "final", "int", "curCount", ",", "final", "long", "thetaLong", ",", "final", "boolean", "dstOrdered", ")", "{", "if", "(", "curCount", "==", "0", ")", ...
Compact the given array. The source cache can be a hash table with interstitial zeros or "dirty" values. @param srcCache anything @param curCount must be correct @param thetaLong The correct <a href="{@docRoot}/resources/dictionary.html#thetaLong">thetaLong</a>. @param dstOrdered true if output array must be sorted @re...
[ "Compact", "the", "given", "array", ".", "The", "source", "cache", "can", "be", "a", "hash", "table", "with", "interstitial", "zeros", "or", "dirty", "values", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/CompactSketch.java#L72-L90
54,861
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/CompactSketch.java
CompactSketch.compactCachePart
static final long[] compactCachePart(final long[] srcCache, final int lgArrLongs, final int curCount, final long thetaLong, final boolean dstOrdered) { if (curCount == 0) { return new long[0]; } final long[] cacheOut = new long[curCount]; final int len = 1 << lgArrLongs; int j = 0; f...
java
static final long[] compactCachePart(final long[] srcCache, final int lgArrLongs, final int curCount, final long thetaLong, final boolean dstOrdered) { if (curCount == 0) { return new long[0]; } final long[] cacheOut = new long[curCount]; final int len = 1 << lgArrLongs; int j = 0; f...
[ "static", "final", "long", "[", "]", "compactCachePart", "(", "final", "long", "[", "]", "srcCache", ",", "final", "int", "lgArrLongs", ",", "final", "int", "curCount", ",", "final", "long", "thetaLong", ",", "final", "boolean", "dstOrdered", ")", "{", "if...
Compact first 2^lgArrLongs of given array @param srcCache anything @param lgArrLongs The correct <a href="{@docRoot}/resources/dictionary.html#lgArrLongs">lgArrLongs</a>. @param curCount must be correct @param thetaLong The correct <a href="{@docRoot}/resources/dictionary.html#thetaLong">thetaLong</a>. @param dstOrdere...
[ "Compact", "first", "2^lgArrLongs", "of", "given", "array" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/CompactSketch.java#L103-L121
54,862
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/CompactSketch.java
CompactSketch.loadCompactMemory
static final Memory loadCompactMemory(final long[] compactCache, final short seedHash, final int curCount, final long thetaLong, final WritableMemory dstMem, final byte flags, final int preLongs) { assert (dstMem != null) && (compactCache != null); final int outLongs = preLongs + curCount; fina...
java
static final Memory loadCompactMemory(final long[] compactCache, final short seedHash, final int curCount, final long thetaLong, final WritableMemory dstMem, final byte flags, final int preLongs) { assert (dstMem != null) && (compactCache != null); final int outLongs = preLongs + curCount; fina...
[ "static", "final", "Memory", "loadCompactMemory", "(", "final", "long", "[", "]", "compactCache", ",", "final", "short", "seedHash", ",", "final", "int", "curCount", ",", "final", "long", "thetaLong", ",", "final", "WritableMemory", "dstMem", ",", "final", "by...
compactCache and dstMem must be valid
[ "compactCache", "and", "dstMem", "must", "be", "valid" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/CompactSketch.java#L124-L160
54,863
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/frequencies/LongsSketch.java
LongsSketch.getInstance
public static LongsSketch getInstance(final String string) { final String[] tokens = string.split(","); if (tokens.length < (STR_PREAMBLE_TOKENS + 2)) { throw new SketchesArgumentException( "String not long enough: " + tokens.length); } final int serVer = Integer.parseInt(tokens[0]); ...
java
public static LongsSketch getInstance(final String string) { final String[] tokens = string.split(","); if (tokens.length < (STR_PREAMBLE_TOKENS + 2)) { throw new SketchesArgumentException( "String not long enough: " + tokens.length); } final int serVer = Integer.parseInt(tokens[0]); ...
[ "public", "static", "LongsSketch", "getInstance", "(", "final", "String", "string", ")", "{", "final", "String", "[", "]", "tokens", "=", "string", ".", "split", "(", "\",\"", ")", ";", "if", "(", "tokens", ".", "length", "<", "(", "STR_PREAMBLE_TOKENS", ...
Returns a sketch instance of this class from the given String, which must be a String representation of this sketch class. @param string a String representation of a sketch of this class. @return a sketch instance of this class.
[ "Returns", "a", "sketch", "instance", "of", "this", "class", "from", "the", "given", "String", "which", "must", "be", "a", "String", "representation", "of", "this", "sketch", "class", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/frequencies/LongsSketch.java#L275-L313
54,864
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/frequencies/LongsSketch.java
LongsSketch.serializeToString
public String serializeToString() { final StringBuilder sb = new StringBuilder(); //start the string with parameters of the sketch final int serVer = SER_VER; //0 final int famID = Family.FREQUENCY.getID(); //1 final int lgMaxMapSz = lgMaxMapSize; //2 final int flags = (ha...
java
public String serializeToString() { final StringBuilder sb = new StringBuilder(); //start the string with parameters of the sketch final int serVer = SER_VER; //0 final int famID = Family.FREQUENCY.getID(); //1 final int lgMaxMapSz = lgMaxMapSize; //2 final int flags = (ha...
[ "public", "String", "serializeToString", "(", ")", "{", "final", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "//start the string with parameters of the sketch", "final", "int", "serVer", "=", "SER_VER", ";", "//0", "final", "int", "famID", "...
Returns a String representation of this sketch @return a String representation of this sketch
[ "Returns", "a", "String", "representation", "of", "this", "sketch" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/frequencies/LongsSketch.java#L522-L537
54,865
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/frequencies/LongsSketch.java
LongsSketch.deserializeFromStringArray
static ReversePurgeLongHashMap deserializeFromStringArray(final String[] tokens) { final int ignore = STR_PREAMBLE_TOKENS; final int numActive = Integer.parseInt(tokens[ignore]); final int length = Integer.parseInt(tokens[ignore + 1]); final ReversePurgeLongHashMap hashMap = new ReversePurgeLongHashMap(...
java
static ReversePurgeLongHashMap deserializeFromStringArray(final String[] tokens) { final int ignore = STR_PREAMBLE_TOKENS; final int numActive = Integer.parseInt(tokens[ignore]); final int length = Integer.parseInt(tokens[ignore + 1]); final ReversePurgeLongHashMap hashMap = new ReversePurgeLongHashMap(...
[ "static", "ReversePurgeLongHashMap", "deserializeFromStringArray", "(", "final", "String", "[", "]", "tokens", ")", "{", "final", "int", "ignore", "=", "STR_PREAMBLE_TOKENS", ";", "final", "int", "numActive", "=", "Integer", ".", "parseInt", "(", "tokens", "[", ...
Deserializes an array of String tokens into a hash map object of this class. @param tokens the given array of Strings tokens. @return a hash map object of this class
[ "Deserializes", "an", "array", "of", "String", "tokens", "into", "a", "hash", "map", "object", "of", "this", "class", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/frequencies/LongsSketch.java#L793-L805
54,866
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/hllmap/HllMap.java
HllMap.findKey
@Override final int findKey(final byte[] key) { final int keyLen = key.length; final long[] hash = MurmurHash3.hash(key, SEED); int entryIndex = getIndex(hash[0], tableEntries_); final int stride = getStride(hash[1], tableEntries_); final int loopIndex = entryIndex; do { if (isBitClear...
java
@Override final int findKey(final byte[] key) { final int keyLen = key.length; final long[] hash = MurmurHash3.hash(key, SEED); int entryIndex = getIndex(hash[0], tableEntries_); final int stride = getStride(hash[1], tableEntries_); final int loopIndex = entryIndex; do { if (isBitClear...
[ "@", "Override", "final", "int", "findKey", "(", "final", "byte", "[", "]", "key", ")", "{", "final", "int", "keyLen", "=", "key", ".", "length", ";", "final", "long", "[", "]", "hash", "=", "MurmurHash3", ".", "hash", "(", "key", ",", "SEED", ")",...
Returns the entry index for the given key given the array of keys, if found. Otherwise, returns the one's complement of first empty entry found; @param key the key to search for @return the entry index of the given key, or the one's complement of the index if not found.
[ "Returns", "the", "entry", "index", "for", "the", "given", "key", "given", "the", "array", "of", "keys", "if", "found", ".", "Otherwise", "returns", "the", "one", "s", "complement", "of", "first", "empty", "entry", "found", ";" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hllmap/HllMap.java#L127-L145
54,867
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/hllmap/HllMap.java
HllMap.findEmpty
private static final int findEmpty(final byte[] key, final int tableEntries, final byte[] stateArr) { final long[] hash = MurmurHash3.hash(key, SEED); int entryIndex = getIndex(hash[0], tableEntries); final int stride = getStride(hash[1], tableEntries); final int loopIndex = entryIndex; do { ...
java
private static final int findEmpty(final byte[] key, final int tableEntries, final byte[] stateArr) { final long[] hash = MurmurHash3.hash(key, SEED); int entryIndex = getIndex(hash[0], tableEntries); final int stride = getStride(hash[1], tableEntries); final int loopIndex = entryIndex; do { ...
[ "private", "static", "final", "int", "findEmpty", "(", "final", "byte", "[", "]", "key", ",", "final", "int", "tableEntries", ",", "final", "byte", "[", "]", "stateArr", ")", "{", "final", "long", "[", "]", "hash", "=", "MurmurHash3", ".", "hash", "(",...
Find the first empty slot for the given key. Only used by resize, where it is known that the key does not exist in the table. Throws an exception if no empty slots. @param key the given key @param tableEntries prime size of table @param stateArr the valid bit array @return the first empty slot for the given key
[ "Find", "the", "first", "empty", "slot", "for", "the", "given", "key", ".", "Only", "used", "by", "resize", "where", "it", "is", "known", "that", "the", "key", "does", "not", "exist", "in", "the", "table", ".", "Throws", "an", "exception", "if", "no", ...
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hllmap/HllMap.java#L236-L249
54,868
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/hllmap/HllMap.java
HllMap.updateHll
private final boolean updateHll(final int entryIndex, final int coupon) { final int newValue = coupon16Value(coupon); final int hllIdx = coupon & (k_ - 1); //lower lgK bits final int longIdx = hllIdx / 10; final int shift = ((hllIdx % 10) * 6) & SIX_BIT_MASK; long hllLong = arrOfHllArr_[(entryInde...
java
private final boolean updateHll(final int entryIndex, final int coupon) { final int newValue = coupon16Value(coupon); final int hllIdx = coupon & (k_ - 1); //lower lgK bits final int longIdx = hllIdx / 10; final int shift = ((hllIdx % 10) * 6) & SIX_BIT_MASK; long hllLong = arrOfHllArr_[(entryInde...
[ "private", "final", "boolean", "updateHll", "(", "final", "int", "entryIndex", ",", "final", "int", "coupon", ")", "{", "final", "int", "newValue", "=", "coupon16Value", "(", "coupon", ")", ";", "final", "int", "hllIdx", "=", "coupon", "&", "(", "k_", "-...
This method is specifically tied to the HLL array layout
[ "This", "method", "is", "specifically", "tied", "to", "the", "HLL", "array", "layout" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hllmap/HllMap.java#L252-L280
54,869
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/cpc/CompressionData.java
CompressionData.makeDecodingTable
private static short[] makeDecodingTable(final short[] encodingTable, final int numByteValues) { final short[] decodingTable = new short[4096]; for (int byteValue = 0; byteValue < numByteValues; byteValue++) { final int encodingEntry = encodingTable[byteValue] & 0xFFFF; final int codeValue = encodi...
java
private static short[] makeDecodingTable(final short[] encodingTable, final int numByteValues) { final short[] decodingTable = new short[4096]; for (int byteValue = 0; byteValue < numByteValues; byteValue++) { final int encodingEntry = encodingTable[byteValue] & 0xFFFF; final int codeValue = encodi...
[ "private", "static", "short", "[", "]", "makeDecodingTable", "(", "final", "short", "[", "]", "encodingTable", ",", "final", "int", "numByteValues", ")", "{", "final", "short", "[", "]", "decodingTable", "=", "new", "short", "[", "4096", "]", ";", "for", ...
Given an encoding table that maps unsigned bytes to codewords of length at most 12, this builds a size-4096 decoding table. <p>The second argument is typically 256, but can be other values such as 65. @param encodingTable unsigned @param numByteValues size of encoding table @return one segment of the decoding table
[ "Given", "an", "encoding", "table", "that", "maps", "unsigned", "bytes", "to", "codewords", "of", "length", "at", "most", "12", "this", "builds", "a", "size", "-", "4096", "decoding", "table", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/cpc/CompressionData.java#L50-L67
54,870
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/cpc/CompressionData.java
CompressionData.validateDecodingTable
static void validateDecodingTable(final short[] decodingTable, final short[] encodingTable) { for (int decodeThis = 0; decodeThis < 4096; decodeThis++) { final int tmpD = decodingTable[decodeThis] & 0xFFFF; final int decodedByte = tmpD & 0xff; final int decodedLength = tmpD >> 8; final in...
java
static void validateDecodingTable(final short[] decodingTable, final short[] encodingTable) { for (int decodeThis = 0; decodeThis < 4096; decodeThis++) { final int tmpD = decodingTable[decodeThis] & 0xFFFF; final int decodedByte = tmpD & 0xff; final int decodedLength = tmpD >> 8; final in...
[ "static", "void", "validateDecodingTable", "(", "final", "short", "[", "]", "decodingTable", ",", "final", "short", "[", "]", "encodingTable", ")", "{", "for", "(", "int", "decodeThis", "=", "0", ";", "decodeThis", "<", "4096", ";", "decodeThis", "++", ")"...
These short arrays are being treated as unsigned @param decodingTable unsigned @param encodingTable unsigned
[ "These", "short", "arrays", "are", "being", "treated", "as", "unsigned" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/cpc/CompressionData.java#L74-L91
54,871
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/DoublesUnionImpl.java
DoublesUnionImpl.directInstance
static DoublesUnionImpl directInstance(final int maxK, final WritableMemory dstMem) { final DirectUpdateDoublesSketch sketch = DirectUpdateDoublesSketch.newInstance(maxK, dstMem); final DoublesUnionImpl union = new DoublesUnionImpl(maxK); union.maxK_ = maxK; union.gadget_ = sketch; return union; }
java
static DoublesUnionImpl directInstance(final int maxK, final WritableMemory dstMem) { final DirectUpdateDoublesSketch sketch = DirectUpdateDoublesSketch.newInstance(maxK, dstMem); final DoublesUnionImpl union = new DoublesUnionImpl(maxK); union.maxK_ = maxK; union.gadget_ = sketch; return union; }
[ "static", "DoublesUnionImpl", "directInstance", "(", "final", "int", "maxK", ",", "final", "WritableMemory", "dstMem", ")", "{", "final", "DirectUpdateDoublesSketch", "sketch", "=", "DirectUpdateDoublesSketch", ".", "newInstance", "(", "maxK", ",", "dstMem", ")", ";...
Returns a empty DoublesUnion object that refers to the given direct, off-heap Memory, which will be initialized to the empty state. @param maxK determines the accuracy and size of the union and is a maximum value. The effective <i>k</i> can be smaller due to unions with smaller <i>k</i> sketches. It is recommended tha...
[ "Returns", "a", "empty", "DoublesUnion", "object", "that", "refers", "to", "the", "given", "direct", "off", "-", "heap", "Memory", "which", "will", "be", "initialized", "to", "the", "empty", "state", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/DoublesUnionImpl.java#L48-L54
54,872
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/DoublesUnionImpl.java
DoublesUnionImpl.heapifyInstance
static DoublesUnionImpl heapifyInstance(final DoublesSketch sketch) { final int k = sketch.getK(); final DoublesUnionImpl union = new DoublesUnionImpl(k); union.maxK_ = k; union.gadget_ = copyToHeap(sketch); return union; }
java
static DoublesUnionImpl heapifyInstance(final DoublesSketch sketch) { final int k = sketch.getK(); final DoublesUnionImpl union = new DoublesUnionImpl(k); union.maxK_ = k; union.gadget_ = copyToHeap(sketch); return union; }
[ "static", "DoublesUnionImpl", "heapifyInstance", "(", "final", "DoublesSketch", "sketch", ")", "{", "final", "int", "k", "=", "sketch", ".", "getK", "(", ")", ";", "final", "DoublesUnionImpl", "union", "=", "new", "DoublesUnionImpl", "(", "k", ")", ";", "uni...
Returns a Heap DoublesUnion object that has been initialized with the data from the given sketch. @param sketch A DoublesSketch to be used as a source of data only and will not be modified. @return a DoublesUnion object
[ "Returns", "a", "Heap", "DoublesUnion", "object", "that", "has", "been", "initialized", "with", "the", "data", "from", "the", "given", "sketch", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/DoublesUnionImpl.java#L63-L69
54,873
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/DoublesUnionImpl.java
DoublesUnionImpl.wrapInstance
static DoublesUnionImpl wrapInstance(final WritableMemory mem) { final DirectUpdateDoublesSketch sketch = DirectUpdateDoublesSketch.wrapInstance(mem); final DoublesUnionImpl union = new DoublesUnionImpl(sketch.getK()); union.gadget_ = sketch; return union; }
java
static DoublesUnionImpl wrapInstance(final WritableMemory mem) { final DirectUpdateDoublesSketch sketch = DirectUpdateDoublesSketch.wrapInstance(mem); final DoublesUnionImpl union = new DoublesUnionImpl(sketch.getK()); union.gadget_ = sketch; return union; }
[ "static", "DoublesUnionImpl", "wrapInstance", "(", "final", "WritableMemory", "mem", ")", "{", "final", "DirectUpdateDoublesSketch", "sketch", "=", "DirectUpdateDoublesSketch", ".", "wrapInstance", "(", "mem", ")", ";", "final", "DoublesUnionImpl", "union", "=", "new"...
Returns an updatable Union object that wraps off-heap data structure of the given memory image of a non-compact DoublesSketch. The data structures of the Union remain off-heap. @param mem A memory image of a non-compact DoublesSketch to be used as the data structure for the union and will be modified. @return a Union ...
[ "Returns", "an", "updatable", "Union", "object", "that", "wraps", "off", "-", "heap", "data", "structure", "of", "the", "given", "memory", "image", "of", "a", "non", "-", "compact", "DoublesSketch", ".", "The", "data", "structures", "of", "the", "Union", "...
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/DoublesUnionImpl.java#L95-L100
54,874
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/Sketch.java
Sketch.heapify
public static Sketch heapify(final Memory srcMem, final long seed) { final int serVer = srcMem.getByte(SER_VER_BYTE); if (serVer == 3) { final byte famID = srcMem.getByte(FAMILY_BYTE); final boolean ordered = (srcMem.getByte(FLAGS_BYTE) & ORDERED_FLAG_MASK) != 0; return constructHeapSketch(fam...
java
public static Sketch heapify(final Memory srcMem, final long seed) { final int serVer = srcMem.getByte(SER_VER_BYTE); if (serVer == 3) { final byte famID = srcMem.getByte(FAMILY_BYTE); final boolean ordered = (srcMem.getByte(FLAGS_BYTE) & ORDERED_FLAG_MASK) != 0; return constructHeapSketch(fam...
[ "public", "static", "Sketch", "heapify", "(", "final", "Memory", "srcMem", ",", "final", "long", "seed", ")", "{", "final", "int", "serVer", "=", "srcMem", ".", "getByte", "(", "SER_VER_BYTE", ")", ";", "if", "(", "serVer", "==", "3", ")", "{", "final"...
Heapify takes the sketch image in Memory and instantiates an on-heap Sketch using the given seed. The resulting sketch will not retain any link to the source Memory. @param srcMem an image of a Sketch where the image seed hash matches the given seed hash. <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a...
[ "Heapify", "takes", "the", "sketch", "image", "in", "Memory", "and", "instantiates", "an", "on", "-", "heap", "Sketch", "using", "the", "given", "seed", ".", "The", "resulting", "sketch", "will", "not", "retain", "any", "link", "to", "the", "source", "Memo...
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/Sketch.java#L66-L80
54,875
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/Sketch.java
Sketch.isValidSketchID
static final boolean isValidSketchID(final int id) { return (id == Family.ALPHA.getID()) || (id == Family.QUICKSELECT.getID()) || (id == Family.COMPACT.getID()); }
java
static final boolean isValidSketchID(final int id) { return (id == Family.ALPHA.getID()) || (id == Family.QUICKSELECT.getID()) || (id == Family.COMPACT.getID()); }
[ "static", "final", "boolean", "isValidSketchID", "(", "final", "int", "id", ")", "{", "return", "(", "id", "==", "Family", ".", "ALPHA", ".", "getID", "(", ")", ")", "||", "(", "id", "==", "Family", ".", "QUICKSELECT", ".", "getID", "(", ")", ")", ...
Returns true if given Family id is one of the theta sketches @param id the given Family id @return true if given Family id is one of the theta sketches
[ "Returns", "true", "if", "given", "Family", "id", "is", "one", "of", "the", "theta", "sketches" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/Sketch.java#L536-L540
54,876
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/Sketch.java
Sketch.checkSketchAndMemoryFlags
static final void checkSketchAndMemoryFlags(final Sketch sketch) { final Memory mem = sketch.getMemory(); if (mem == null) { return; } final int flags = PreambleUtil.extractFlags(mem); if (((flags & COMPACT_FLAG_MASK) > 0) ^ sketch.isCompact()) { throw new SketchesArgumentException("Possible corru...
java
static final void checkSketchAndMemoryFlags(final Sketch sketch) { final Memory mem = sketch.getMemory(); if (mem == null) { return; } final int flags = PreambleUtil.extractFlags(mem); if (((flags & COMPACT_FLAG_MASK) > 0) ^ sketch.isCompact()) { throw new SketchesArgumentException("Possible corru...
[ "static", "final", "void", "checkSketchAndMemoryFlags", "(", "final", "Sketch", "sketch", ")", "{", "final", "Memory", "mem", "=", "sketch", ".", "getMemory", "(", ")", ";", "if", "(", "mem", "==", "null", ")", "{", "return", ";", "}", "final", "int", ...
Checks Ordered and Compact flags for integrity between sketch and Memory @param sketch the given sketch
[ "Checks", "Ordered", "and", "Compact", "flags", "for", "integrity", "between", "sketch", "and", "Memory" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/Sketch.java#L546-L558
54,877
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/Sketch.java
Sketch.constructHeapSketch
private static final Sketch constructHeapSketch(final byte famID, final boolean ordered, final Memory srcMem, final long seed) { final boolean compact = (srcMem.getByte(FLAGS_BYTE) & COMPACT_FLAG_MASK) != 0; final Family family = idToFamily(famID); switch (family) { case ALPHA: { if (com...
java
private static final Sketch constructHeapSketch(final byte famID, final boolean ordered, final Memory srcMem, final long seed) { final boolean compact = (srcMem.getByte(FLAGS_BYTE) & COMPACT_FLAG_MASK) != 0; final Family family = idToFamily(famID); switch (family) { case ALPHA: { if (com...
[ "private", "static", "final", "Sketch", "constructHeapSketch", "(", "final", "byte", "famID", ",", "final", "boolean", "ordered", ",", "final", "Memory", "srcMem", ",", "final", "long", "seed", ")", "{", "final", "boolean", "compact", "=", "(", "srcMem", "."...
Instantiates a Heap Sketch from Memory. @param famID the Family ID @param ordered true if the sketch is of the Compact family and ordered @param srcMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a> @param seed <a href="{@docRoot}/resources/dictionary.html#seed">See Update Hash Seed</a>. The seed req...
[ "Instantiates", "a", "Heap", "Sketch", "from", "Memory", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/Sketch.java#L619-L647
54,878
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java
ItemsUnion.getInstance
public static <T> ItemsUnion<T> getInstance(final Comparator<? super T> comparator) { return new ItemsUnion<T>(PreambleUtil.DEFAULT_K, comparator, null); }
java
public static <T> ItemsUnion<T> getInstance(final Comparator<? super T> comparator) { return new ItemsUnion<T>(PreambleUtil.DEFAULT_K, comparator, null); }
[ "public", "static", "<", "T", ">", "ItemsUnion", "<", "T", ">", "getInstance", "(", "final", "Comparator", "<", "?", "super", "T", ">", "comparator", ")", "{", "return", "new", "ItemsUnion", "<", "T", ">", "(", "PreambleUtil", ".", "DEFAULT_K", ",", "c...
Create an instance of ItemsUnion with the default k @param <T> type of item @param comparator to compare items @return an instance of ItemsUnion
[ "Create", "an", "instance", "of", "ItemsUnion", "with", "the", "default", "k" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java#L42-L44
54,879
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java
ItemsUnion.getInstance
public static <T> ItemsUnion<T> getInstance(final int maxK, final Comparator<? super T> comparator) { return new ItemsUnion<>(maxK, comparator, null); }
java
public static <T> ItemsUnion<T> getInstance(final int maxK, final Comparator<? super T> comparator) { return new ItemsUnion<>(maxK, comparator, null); }
[ "public", "static", "<", "T", ">", "ItemsUnion", "<", "T", ">", "getInstance", "(", "final", "int", "maxK", ",", "final", "Comparator", "<", "?", "super", "T", ">", "comparator", ")", "{", "return", "new", "ItemsUnion", "<>", "(", "maxK", ",", "compara...
Create an instance of ItemsUnion @param <T> type of item @param maxK determines the accuracy and size of the union and is a maximum value. The effective <i>k</i> can be smaller due to unions with smaller <i>k</i> sketches. It is recommended that <i>maxK</i> be a power of 2 to enable unioning of sketches with different ...
[ "Create", "an", "instance", "of", "ItemsUnion" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java#L56-L58
54,880
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java
ItemsUnion.getInstance
public static <T> ItemsUnion<T> getInstance(final Memory srcMem, final Comparator<? super T> comparator, final ArrayOfItemsSerDe<T> serDe) { final ItemsSketch<T> gadget = ItemsSketch.getInstance(srcMem, comparator, serDe); return new ItemsUnion<>(gadget.getK(), gadget.getComparator(), gadget); }
java
public static <T> ItemsUnion<T> getInstance(final Memory srcMem, final Comparator<? super T> comparator, final ArrayOfItemsSerDe<T> serDe) { final ItemsSketch<T> gadget = ItemsSketch.getInstance(srcMem, comparator, serDe); return new ItemsUnion<>(gadget.getK(), gadget.getComparator(), gadget); }
[ "public", "static", "<", "T", ">", "ItemsUnion", "<", "T", ">", "getInstance", "(", "final", "Memory", "srcMem", ",", "final", "Comparator", "<", "?", "super", "T", ">", "comparator", ",", "final", "ArrayOfItemsSerDe", "<", "T", ">", "serDe", ")", "{", ...
Heapify the given srcMem into a Union object. @param <T> type of item @param srcMem the given srcMem. A reference to srcMem will not be maintained internally. @param comparator to compare items @param serDe an instance of ArrayOfItemsSerDe @return an instance of ItemsUnion
[ "Heapify", "the", "given", "srcMem", "into", "a", "Union", "object", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java#L69-L73
54,881
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java
ItemsUnion.getInstance
public static <T> ItemsUnion<T> getInstance(final ItemsSketch<T> sketch) { return new ItemsUnion<>(sketch.getK(), sketch.getComparator(), ItemsSketch.copy(sketch)); }
java
public static <T> ItemsUnion<T> getInstance(final ItemsSketch<T> sketch) { return new ItemsUnion<>(sketch.getK(), sketch.getComparator(), ItemsSketch.copy(sketch)); }
[ "public", "static", "<", "T", ">", "ItemsUnion", "<", "T", ">", "getInstance", "(", "final", "ItemsSketch", "<", "T", ">", "sketch", ")", "{", "return", "new", "ItemsUnion", "<>", "(", "sketch", ".", "getK", "(", ")", ",", "sketch", ".", "getComparator...
Create an instance of ItemsUnion based on ItemsSketch @param <T> type of item @param sketch the basis of the union @return an instance of ItemsUnion
[ "Create", "an", "instance", "of", "ItemsUnion", "based", "on", "ItemsSketch" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java#L81-L83
54,882
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java
ItemsUnion.update
public void update(final ItemsSketch<T> sketchIn) { gadget_ = updateLogic(maxK_, comparator_, gadget_, sketchIn); }
java
public void update(final ItemsSketch<T> sketchIn) { gadget_ = updateLogic(maxK_, comparator_, gadget_, sketchIn); }
[ "public", "void", "update", "(", "final", "ItemsSketch", "<", "T", ">", "sketchIn", ")", "{", "gadget_", "=", "updateLogic", "(", "maxK_", ",", "comparator_", ",", "gadget_", ",", "sketchIn", ")", ";", "}" ]
Iterative union operation, which means this method can be repeatedly called. Merges the given sketch into this union object. The given sketch is not modified. It is required that the ratio of the two K values be a power of 2. This is easily satisfied if each of the K values is already a power of 2. If the given sketch ...
[ "Iterative", "union", "operation", "which", "means", "this", "method", "can", "be", "repeatedly", "called", ".", "Merges", "the", "given", "sketch", "into", "this", "union", "object", ".", "The", "given", "sketch", "is", "not", "modified", ".", "It", "is", ...
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java#L98-L100
54,883
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java
ItemsUnion.update
public void update(final Memory srcMem, final ArrayOfItemsSerDe<T> serDe) { final ItemsSketch<T> that = ItemsSketch.getInstance(srcMem, comparator_, serDe); gadget_ = updateLogic(maxK_, comparator_, gadget_, that); }
java
public void update(final Memory srcMem, final ArrayOfItemsSerDe<T> serDe) { final ItemsSketch<T> that = ItemsSketch.getInstance(srcMem, comparator_, serDe); gadget_ = updateLogic(maxK_, comparator_, gadget_, that); }
[ "public", "void", "update", "(", "final", "Memory", "srcMem", ",", "final", "ArrayOfItemsSerDe", "<", "T", ">", "serDe", ")", "{", "final", "ItemsSketch", "<", "T", ">", "that", "=", "ItemsSketch", ".", "getInstance", "(", "srcMem", ",", "comparator_", ","...
Iterative union operation, which means this method can be repeatedly called. Merges the given Memory image of a ItemsSketch into this union object. The given Memory object is not modified and a link to it is not retained. It is required that the ratio of the two K values be a power of 2. This is easily satisfied if eac...
[ "Iterative", "union", "operation", "which", "means", "this", "method", "can", "be", "repeatedly", "called", ".", "Merges", "the", "given", "Memory", "image", "of", "a", "ItemsSketch", "into", "this", "union", "object", ".", "The", "given", "Memory", "object", ...
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java#L115-L118
54,884
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java
ItemsUnion.getResult
public ItemsSketch<T> getResult() { if (gadget_ == null) { return ItemsSketch.getInstance(maxK_, comparator_); } return ItemsSketch.copy(gadget_); //can't have any externally owned handles. }
java
public ItemsSketch<T> getResult() { if (gadget_ == null) { return ItemsSketch.getInstance(maxK_, comparator_); } return ItemsSketch.copy(gadget_); //can't have any externally owned handles. }
[ "public", "ItemsSketch", "<", "T", ">", "getResult", "(", ")", "{", "if", "(", "gadget_", "==", "null", ")", "{", "return", "ItemsSketch", ".", "getInstance", "(", "maxK_", ",", "comparator_", ")", ";", "}", "return", "ItemsSketch", ".", "copy", "(", "...
Gets the result of this Union operation as a copy of the internal state. This enables further union update operations on this state. @return the result of this Union operation
[ "Gets", "the", "result", "of", "this", "Union", "operation", "as", "a", "copy", "of", "the", "internal", "state", ".", "This", "enables", "further", "union", "update", "operations", "on", "this", "state", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsUnion.java#L138-L143
54,885
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/frequencies/PreambleUtil.java
PreambleUtil.checkPreambleSize
static long checkPreambleSize(final Memory mem) { final long cap = mem.getCapacity(); if (cap < 8) { throwNotBigEnough(cap, 8); } final long pre0 = mem.getLong(0); final int preLongs = (int) (pre0 & 0X3FL); //lower 6 bits final int required = Math.max(preLongs << 3, 8); if (cap < required) { thr...
java
static long checkPreambleSize(final Memory mem) { final long cap = mem.getCapacity(); if (cap < 8) { throwNotBigEnough(cap, 8); } final long pre0 = mem.getLong(0); final int preLongs = (int) (pre0 & 0X3FL); //lower 6 bits final int required = Math.max(preLongs << 3, 8); if (cap < required) { thr...
[ "static", "long", "checkPreambleSize", "(", "final", "Memory", "mem", ")", "{", "final", "long", "cap", "=", "mem", ".", "getCapacity", "(", ")", ";", "if", "(", "cap", "<", "8", ")", "{", "throwNotBigEnough", "(", "cap", ",", "8", ")", ";", "}", "...
Checks Memory for capacity to hold the preamble and returns the first 8 bytes. @param mem the given Memory @return the first 8 bytes of preamble as a long.
[ "Checks", "Memory", "for", "capacity", "to", "hold", "the", "preamble", "and", "returns", "the", "first", "8", "bytes", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/frequencies/PreambleUtil.java#L244-L252
54,886
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/UnionImpl.java
UnionImpl.initNewHeapInstance
static UnionImpl initNewHeapInstance(final int lgNomLongs, final long seed, final float p, final ResizeFactor rf) { final UpdateSketch gadget = new HeapQuickSelectSketch( lgNomLongs, seed, p, rf, true); //create with UNION family final UnionImpl unionImpl = new UnionImpl(gadget, seed); unionIm...
java
static UnionImpl initNewHeapInstance(final int lgNomLongs, final long seed, final float p, final ResizeFactor rf) { final UpdateSketch gadget = new HeapQuickSelectSketch( lgNomLongs, seed, p, rf, true); //create with UNION family final UnionImpl unionImpl = new UnionImpl(gadget, seed); unionIm...
[ "static", "UnionImpl", "initNewHeapInstance", "(", "final", "int", "lgNomLongs", ",", "final", "long", "seed", ",", "final", "float", "p", ",", "final", "ResizeFactor", "rf", ")", "{", "final", "UpdateSketch", "gadget", "=", "new", "HeapQuickSelectSketch", "(", ...
Construct a new Union SetOperation on the java heap. Called by SetOperationBuilder. @param lgNomLongs <a href="{@docRoot}/resources/dictionary.html#lgNomLogs">See lgNomLongs</a> @param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a> @param p <a href="{@docRoot}/resources/dictionary.html#p">See Sa...
[ "Construct", "a", "new", "Union", "SetOperation", "on", "the", "java", "heap", ".", "Called", "by", "SetOperationBuilder", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/UnionImpl.java#L74-L82
54,887
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/UnionImpl.java
UnionImpl.initNewDirectInstance
static UnionImpl initNewDirectInstance( final int lgNomLongs, final long seed, final float p, final ResizeFactor rf, final MemoryRequestServer memReqSvr, final WritableMemory dstMem) { final UpdateSketch gadget = new DirectQuickSelectSketch( lgNomLongs, seed, p, rf, memRe...
java
static UnionImpl initNewDirectInstance( final int lgNomLongs, final long seed, final float p, final ResizeFactor rf, final MemoryRequestServer memReqSvr, final WritableMemory dstMem) { final UpdateSketch gadget = new DirectQuickSelectSketch( lgNomLongs, seed, p, rf, memRe...
[ "static", "UnionImpl", "initNewDirectInstance", "(", "final", "int", "lgNomLongs", ",", "final", "long", "seed", ",", "final", "float", "p", ",", "final", "ResizeFactor", "rf", ",", "final", "MemoryRequestServer", "memReqSvr", ",", "final", "WritableMemory", "dstM...
Construct a new Direct Union in the off-heap destination Memory. Called by SetOperationBuilder. @param lgNomLongs <a href="{@docRoot}/resources/dictionary.html#lgNomLogs">See lgNomLongs</a>. @param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a> @param p <a href="{@docRoot}/resources/dictionary.h...
[ "Construct", "a", "new", "Direct", "Union", "in", "the", "off", "-", "heap", "destination", "Memory", ".", "Called", "by", "SetOperationBuilder", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/UnionImpl.java#L96-L109
54,888
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/UnionImpl.java
UnionImpl.heapifyInstance
static UnionImpl heapifyInstance(final Memory srcMem, final long seed) { Family.UNION.checkFamilyID(extractFamilyID(srcMem)); final UpdateSketch gadget = HeapQuickSelectSketch.heapifyInstance(srcMem, seed); final UnionImpl unionImpl = new UnionImpl(gadget, seed); unionImpl.unionThetaLong_ = extractUnion...
java
static UnionImpl heapifyInstance(final Memory srcMem, final long seed) { Family.UNION.checkFamilyID(extractFamilyID(srcMem)); final UpdateSketch gadget = HeapQuickSelectSketch.heapifyInstance(srcMem, seed); final UnionImpl unionImpl = new UnionImpl(gadget, seed); unionImpl.unionThetaLong_ = extractUnion...
[ "static", "UnionImpl", "heapifyInstance", "(", "final", "Memory", "srcMem", ",", "final", "long", "seed", ")", "{", "Family", ".", "UNION", ".", "checkFamilyID", "(", "extractFamilyID", "(", "srcMem", ")", ")", ";", "final", "UpdateSketch", "gadget", "=", "H...
Heapify a Union from a Memory Union object containing data. Called by SetOperation. @param srcMem The source Memory Union object. <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a> @param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a> @return this class
[ "Heapify", "a", "Union", "from", "a", "Memory", "Union", "object", "containing", "data", ".", "Called", "by", "SetOperation", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/UnionImpl.java#L119-L126
54,889
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/UnionImpl.java
UnionImpl.fastWrap
static UnionImpl fastWrap(final WritableMemory srcMem, final long seed) { Family.UNION.checkFamilyID(extractFamilyID(srcMem)); final UpdateSketch gadget = DirectQuickSelectSketch.fastWritableWrap(srcMem, seed); final UnionImpl unionImpl = new UnionImpl(gadget, seed); unionImpl.unionThetaLong_ = extractU...
java
static UnionImpl fastWrap(final WritableMemory srcMem, final long seed) { Family.UNION.checkFamilyID(extractFamilyID(srcMem)); final UpdateSketch gadget = DirectQuickSelectSketch.fastWritableWrap(srcMem, seed); final UnionImpl unionImpl = new UnionImpl(gadget, seed); unionImpl.unionThetaLong_ = extractU...
[ "static", "UnionImpl", "fastWrap", "(", "final", "WritableMemory", "srcMem", ",", "final", "long", "seed", ")", "{", "Family", ".", "UNION", ".", "checkFamilyID", "(", "extractFamilyID", "(", "srcMem", ")", ")", ";", "final", "UpdateSketch", "gadget", "=", "...
Fast-wrap a Union object around a Union Memory object containing data. This does NO validity checking of the given Memory. @param srcMem The source Memory object. <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a> @param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a> @return this c...
[ "Fast", "-", "wrap", "a", "Union", "object", "around", "a", "Union", "Memory", "object", "containing", "data", ".", "This", "does", "NO", "validity", "checking", "of", "the", "given", "Memory", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/UnionImpl.java#L153-L160
54,890
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/UnionImpl.java
UnionImpl.wrapInstance
static UnionImpl wrapInstance(final Memory srcMem, final long seed) { Family.UNION.checkFamilyID(extractFamilyID(srcMem)); final UpdateSketch gadget = DirectQuickSelectSketchR.readOnlyWrap(srcMem, seed); final UnionImpl unionImpl = new UnionImpl(gadget, seed); unionImpl.unionThetaLong_ = extractUnionThe...
java
static UnionImpl wrapInstance(final Memory srcMem, final long seed) { Family.UNION.checkFamilyID(extractFamilyID(srcMem)); final UpdateSketch gadget = DirectQuickSelectSketchR.readOnlyWrap(srcMem, seed); final UnionImpl unionImpl = new UnionImpl(gadget, seed); unionImpl.unionThetaLong_ = extractUnionThe...
[ "static", "UnionImpl", "wrapInstance", "(", "final", "Memory", "srcMem", ",", "final", "long", "seed", ")", "{", "Family", ".", "UNION", ".", "checkFamilyID", "(", "extractFamilyID", "(", "srcMem", ")", ")", ";", "final", "UpdateSketch", "gadget", "=", "Dire...
Wrap a Union object around a Union Memory object containing data. Called by SetOperation. @param srcMem The source Memory object. <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a> @param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a> @return this class
[ "Wrap", "a", "Union", "object", "around", "a", "Union", "Memory", "object", "containing", "data", ".", "Called", "by", "SetOperation", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/UnionImpl.java#L170-L177
54,891
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/UnionImpl.java
UnionImpl.processVer1
private void processVer1(final Memory skMem) { final long thetaLongIn = skMem.getLong(THETA_LONG); unionThetaLong_ = min(unionThetaLong_, thetaLongIn); //Theta rule final int curCount = skMem.getInt(RETAINED_ENTRIES_INT); final int preLongs = 3; for (int i = 0; i < curCount; i++ ) { final int ...
java
private void processVer1(final Memory skMem) { final long thetaLongIn = skMem.getLong(THETA_LONG); unionThetaLong_ = min(unionThetaLong_, thetaLongIn); //Theta rule final int curCount = skMem.getInt(RETAINED_ENTRIES_INT); final int preLongs = 3; for (int i = 0; i < curCount; i++ ) { final int ...
[ "private", "void", "processVer1", "(", "final", "Memory", "skMem", ")", "{", "final", "long", "thetaLongIn", "=", "skMem", ".", "getLong", "(", "THETA_LONG", ")", ";", "unionThetaLong_", "=", "min", "(", "unionThetaLong_", ",", "thetaLongIn", ")", ";", "//Th...
can only be compact, ordered, size > 24
[ "can", "only", "be", "compact", "ordered", "size", ">", "24" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/UnionImpl.java#L406-L419
54,892
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/UnionImpl.java
UnionImpl.processVer2
private void processVer2(final Memory skMem) { Util.checkSeedHashes(seedHash_, skMem.getShort(SEED_HASH_SHORT)); final int preLongs = skMem.getByte(PREAMBLE_LONGS_BYTE) & 0X3F; final int curCount = skMem.getInt(RETAINED_ENTRIES_INT); final long thetaLongIn; if (preLongs == 1) { //does not change any...
java
private void processVer2(final Memory skMem) { Util.checkSeedHashes(seedHash_, skMem.getShort(SEED_HASH_SHORT)); final int preLongs = skMem.getByte(PREAMBLE_LONGS_BYTE) & 0X3F; final int curCount = skMem.getInt(RETAINED_ENTRIES_INT); final long thetaLongIn; if (preLongs == 1) { //does not change any...
[ "private", "void", "processVer2", "(", "final", "Memory", "skMem", ")", "{", "Util", ".", "checkSeedHashes", "(", "seedHash_", ",", "skMem", ".", "getShort", "(", "SEED_HASH_SHORT", ")", ")", ";", "final", "int", "preLongs", "=", "skMem", ".", "getByte", "...
can only be compact, ordered, size >= 8
[ "can", "only", "be", "compact", "ordered", "size", ">", "=", "8" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/UnionImpl.java#L423-L446
54,893
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/UnionImpl.java
UnionImpl.processVer3
private void processVer3(final Memory skMem) { Util.checkSeedHashes(seedHash_, skMem.getShort(SEED_HASH_SHORT)); final int preLongs = skMem.getByte(PREAMBLE_LONGS_BYTE) & 0X3F; final int curCount; final long thetaLongIn; if (preLongs == 1) { //SingleItemSketch if not empty, Read-Only, Compact and Or...
java
private void processVer3(final Memory skMem) { Util.checkSeedHashes(seedHash_, skMem.getShort(SEED_HASH_SHORT)); final int preLongs = skMem.getByte(PREAMBLE_LONGS_BYTE) & 0X3F; final int curCount; final long thetaLongIn; if (preLongs == 1) { //SingleItemSketch if not empty, Read-Only, Compact and Or...
[ "private", "void", "processVer3", "(", "final", "Memory", "skMem", ")", "{", "Util", ".", "checkSeedHashes", "(", "seedHash_", ",", "skMem", ".", "getShort", "(", "SEED_HASH_SHORT", ")", ")", ";", "final", "int", "preLongs", "=", "skMem", ".", "getByte", "...
could be unordered, ordered, compact, or not, size >= 8
[ "could", "be", "unordered", "ordered", "compact", "or", "not", "size", ">", "=", "8" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/UnionImpl.java#L450-L496
54,894
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/hll/CubicInterpolation.java
CubicInterpolation.usingXArrAndYStride
static double usingXArrAndYStride( final double[] xArr, final double yStride, final double x) { final int xArrLen = xArr.length; final int xArrLenM1 = xArrLen - 1; final int offset; assert ((xArrLen >= 4) && (x >= xArr[0]) && (x <= xArr[xArrLenM1])); if (x == xArr[xArrLenM1]) { /* corner ca...
java
static double usingXArrAndYStride( final double[] xArr, final double yStride, final double x) { final int xArrLen = xArr.length; final int xArrLenM1 = xArrLen - 1; final int offset; assert ((xArrLen >= 4) && (x >= xArr[0]) && (x <= xArr[xArrLenM1])); if (x == xArr[xArrLenM1]) { /* corner ca...
[ "static", "double", "usingXArrAndYStride", "(", "final", "double", "[", "]", "xArr", ",", "final", "double", "yStride", ",", "final", "double", "x", ")", "{", "final", "int", "xArrLen", "=", "xArr", ".", "length", ";", "final", "int", "xArrLenM1", "=", "...
Used by HllEstimators
[ "Used", "by", "HllEstimators" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hll/CubicInterpolation.java#L60-L84
54,895
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/hll/Union.java
Union.heapify
public static final Union heapify(final Memory mem) { final int lgK = HllUtil.checkLgK(mem.getByte(PreambleUtil.LG_K_BYTE)); final HllSketch sk = HllSketch.heapify(mem); final Union union = new Union(lgK); union.update(sk); return union; }
java
public static final Union heapify(final Memory mem) { final int lgK = HllUtil.checkLgK(mem.getByte(PreambleUtil.LG_K_BYTE)); final HllSketch sk = HllSketch.heapify(mem); final Union union = new Union(lgK); union.update(sk); return union; }
[ "public", "static", "final", "Union", "heapify", "(", "final", "Memory", "mem", ")", "{", "final", "int", "lgK", "=", "HllUtil", ".", "checkLgK", "(", "mem", ".", "getByte", "(", "PreambleUtil", ".", "LG_K_BYTE", ")", ")", ";", "final", "HllSketch", "sk"...
Construct a union operator populated with the given Memory image of an HllSketch. @param mem the given Memory @return a union operator populated with the given Memory image of an HllSketch.
[ "Construct", "a", "union", "operator", "populated", "with", "the", "given", "Memory", "image", "of", "an", "HllSketch", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hll/Union.java#L103-L109
54,896
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/hll/Union.java
Union.update
public void update(final HllSketch sketch) { gadget.hllSketchImpl = unionImpl(sketch.hllSketchImpl, gadget.hllSketchImpl, lgMaxK); }
java
public void update(final HllSketch sketch) { gadget.hllSketchImpl = unionImpl(sketch.hllSketchImpl, gadget.hllSketchImpl, lgMaxK); }
[ "public", "void", "update", "(", "final", "HllSketch", "sketch", ")", "{", "gadget", ".", "hllSketchImpl", "=", "unionImpl", "(", "sketch", ".", "hllSketchImpl", ",", "gadget", ".", "hllSketchImpl", ",", "lgMaxK", ")", ";", "}" ]
Update this union operator with the given sketch. @param sketch the given sketch.
[ "Update", "this", "union", "operator", "with", "the", "given", "sketch", "." ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hll/Union.java#L270-L272
54,897
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/hll/Union.java
Union.copyOrDownsampleHll
private static final HllSketchImpl copyOrDownsampleHll( final HllSketchImpl srcImpl, final int tgtLgK) { assert srcImpl.getCurMode() == HLL; final AbstractHllArray src = (AbstractHllArray) srcImpl; final int srcLgK = src.getLgConfigK(); if ((srcLgK <= tgtLgK) && (src.getTgtHllType() == TgtHllType....
java
private static final HllSketchImpl copyOrDownsampleHll( final HllSketchImpl srcImpl, final int tgtLgK) { assert srcImpl.getCurMode() == HLL; final AbstractHllArray src = (AbstractHllArray) srcImpl; final int srcLgK = src.getLgConfigK(); if ((srcLgK <= tgtLgK) && (src.getTgtHllType() == TgtHllType....
[ "private", "static", "final", "HllSketchImpl", "copyOrDownsampleHll", "(", "final", "HllSketchImpl", "srcImpl", ",", "final", "int", "tgtLgK", ")", "{", "assert", "srcImpl", ".", "getCurMode", "(", ")", "==", "HLL", ";", "final", "AbstractHllArray", "src", "=", ...
Caller must ultimately manage oooFlag, as caller has more info
[ "Caller", "must", "ultimately", "manage", "oooFlag", "as", "caller", "has", "more", "info" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hll/Union.java#L438-L456
54,898
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/fdt/Group.java
Group.init
public Group init(final String priKey, final int count, final double estimate, final double ub, final double lb, final double fraction, final double rse) { this.count = count; est = estimate; this.ub = ub; this.lb = lb; this.fraction = fraction; this.rse = rse; this.priKey = priKey; ...
java
public Group init(final String priKey, final int count, final double estimate, final double ub, final double lb, final double fraction, final double rse) { this.count = count; est = estimate; this.ub = ub; this.lb = lb; this.fraction = fraction; this.rse = rse; this.priKey = priKey; ...
[ "public", "Group", "init", "(", "final", "String", "priKey", ",", "final", "int", "count", ",", "final", "double", "estimate", ",", "final", "double", "ub", ",", "final", "double", "lb", ",", "final", "double", "fraction", ",", "final", "double", "rse", ...
Specifies the parameters to be listed as columns @param priKey the primary key of the FDT sketch @param count the number of retained rows associated with this group @param estimate the estimate of the original population associated with this group @param ub the upper bound of the estimate @param lb the lower bound of t...
[ "Specifies", "the", "parameters", "to", "be", "listed", "as", "columns" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/fdt/Group.java#L47-L57
54,899
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/Sketches.java
Sketches.getEstimate
public static double getEstimate(final Memory srcMem) { checkIfValidThetaSketch(srcMem); return Sketch.estimate(getThetaLong(srcMem), getRetainedEntries(srcMem), getEmpty(srcMem)); }
java
public static double getEstimate(final Memory srcMem) { checkIfValidThetaSketch(srcMem); return Sketch.estimate(getThetaLong(srcMem), getRetainedEntries(srcMem), getEmpty(srcMem)); }
[ "public", "static", "double", "getEstimate", "(", "final", "Memory", "srcMem", ")", "{", "checkIfValidThetaSketch", "(", "srcMem", ")", ";", "return", "Sketch", ".", "estimate", "(", "getThetaLong", "(", "srcMem", ")", ",", "getRetainedEntries", "(", "srcMem", ...
Gets the unique count estimate from a valid memory image of a Sketch @param srcMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a> @return the sketch's best estimate of the cardinality of the input stream.
[ "Gets", "the", "unique", "count", "estimate", "from", "a", "valid", "memory", "image", "of", "a", "Sketch" ]
900c8c9668a1e2f1d54d453e956caad54702e540
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/Sketches.java#L280-L283