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
55,500
Netflix/denominator
ultradns/src/main/java/denominator/ultradns/GroupGeoRecordByNameTypeIterator.java
GroupGeoRecordByNameTypeIterator.hasNext
@Override public boolean hasNext() { if (!peekingIterator.hasNext()) { return false; } DirectionalRecord record = peekingIterator.peek(); if (record.noResponseRecord) { // TODO: log as this is unsupported peekingIterator.next(); } return true; }
java
@Override public boolean hasNext() { if (!peekingIterator.hasNext()) { return false; } DirectionalRecord record = peekingIterator.peek(); if (record.noResponseRecord) { // TODO: log as this is unsupported peekingIterator.next(); } return true; }
[ "@", "Override", "public", "boolean", "hasNext", "(", ")", "{", "if", "(", "!", "peekingIterator", ".", "hasNext", "(", ")", ")", "{", "return", "false", ";", "}", "DirectionalRecord", "record", "=", "peekingIterator", ".", "peek", "(", ")", ";", "if", ...
skips no response records as they aren't portable
[ "skips", "no", "response", "records", "as", "they", "aren", "t", "portable" ]
c565e3b8c6043051252e0947029511f9ac5d306f
https://github.com/Netflix/denominator/blob/c565e3b8c6043051252e0947029511f9ac5d306f/ultradns/src/main/java/denominator/ultradns/GroupGeoRecordByNameTypeIterator.java#L44-L55
55,501
Netflix/denominator
clouddns/src/main/java/denominator/clouddns/CloudDNSFunctions.java
CloudDNSFunctions.awaitComplete
static String awaitComplete(CloudDNS api, Job job) { RetryableException retryableException = new RetryableException( format("Job %s did not complete. Check your logs.", job.id), null); Retryer retryer = new Retryer.Default(500, 1000, 30); while (true) { job = api.getStatus(job.id); if ...
java
static String awaitComplete(CloudDNS api, Job job) { RetryableException retryableException = new RetryableException( format("Job %s did not complete. Check your logs.", job.id), null); Retryer retryer = new Retryer.Default(500, 1000, 30); while (true) { job = api.getStatus(job.id); if ...
[ "static", "String", "awaitComplete", "(", "CloudDNS", "api", ",", "Job", "job", ")", "{", "RetryableException", "retryableException", "=", "new", "RetryableException", "(", "format", "(", "\"Job %s did not complete. Check your logs.\"", ",", "job", ".", "id", ")", "...
Returns the ID of the object created or null.
[ "Returns", "the", "ID", "of", "the", "object", "created", "or", "null", "." ]
c565e3b8c6043051252e0947029511f9ac5d306f
https://github.com/Netflix/denominator/blob/c565e3b8c6043051252e0947029511f9ac5d306f/clouddns/src/main/java/denominator/clouddns/CloudDNSFunctions.java#L25-L42
55,502
Netflix/denominator
clouddns/src/main/java/denominator/clouddns/CloudDNSFunctions.java
CloudDNSFunctions.toRDataMap
static Map<String, Object> toRDataMap(Record record) { if ("MX".equals(record.type)) { return MXData.create(record.priority, record.data()); } else if ("TXT".equals(record.type)) { return TXTData.create(record.data()); } else if ("SRV".equals(record.type)) { List<String> rdata = split(' ',...
java
static Map<String, Object> toRDataMap(Record record) { if ("MX".equals(record.type)) { return MXData.create(record.priority, record.data()); } else if ("TXT".equals(record.type)) { return TXTData.create(record.data()); } else if ("SRV".equals(record.type)) { List<String> rdata = split(' ',...
[ "static", "Map", "<", "String", ",", "Object", ">", "toRDataMap", "(", "Record", "record", ")", "{", "if", "(", "\"MX\"", ".", "equals", "(", "record", ".", "type", ")", ")", "{", "return", "MXData", ".", "create", "(", "record", ".", "priority", ","...
Special-cases priority field and the strange and incomplete SOA record.
[ "Special", "-", "cases", "priority", "field", "and", "the", "strange", "and", "incomplete", "SOA", "record", "." ]
c565e3b8c6043051252e0947029511f9ac5d306f
https://github.com/Netflix/denominator/blob/c565e3b8c6043051252e0947029511f9ac5d306f/clouddns/src/main/java/denominator/clouddns/CloudDNSFunctions.java#L47-L71
55,503
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/LoggingConfiguration.java
LoggingConfiguration.stop
public void stop() { MessageBatcher batcher = null; for (String originalAppenderName : originalAsyncAppenderNameMap.keySet()) { String batcherName = AsyncAppender.class.getName() + "." + originalAppenderName; batcher = BatcherFactory.getBatcher(batcherName); if (batch...
java
public void stop() { MessageBatcher batcher = null; for (String originalAppenderName : originalAsyncAppenderNameMap.keySet()) { String batcherName = AsyncAppender.class.getName() + "." + originalAppenderName; batcher = BatcherFactory.getBatcher(batcherName); if (batch...
[ "public", "void", "stop", "(", ")", "{", "MessageBatcher", "batcher", "=", "null", ";", "for", "(", "String", "originalAppenderName", ":", "originalAsyncAppenderNameMap", ".", "keySet", "(", ")", ")", "{", "String", "batcherName", "=", "AsyncAppender", ".", "c...
Shuts down blitz4j cleanly by flushing out all the async related messages.
[ "Shuts", "down", "blitz4j", "cleanly", "by", "flushing", "out", "all", "the", "async", "related", "messages", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/LoggingConfiguration.java#L259-L278
55,504
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/LoggingConfiguration.java
LoggingConfiguration.reconfigure
public synchronized void reconfigure(Properties props) { // First isolate any property that is different from the immutable // set of original initialization properties Properties newOverrideProps = new Properties(); for (Entry<Object, Object> prop : props.entrySet()) { if (i...
java
public synchronized void reconfigure(Properties props) { // First isolate any property that is different from the immutable // set of original initialization properties Properties newOverrideProps = new Properties(); for (Entry<Object, Object> prop : props.entrySet()) { if (i...
[ "public", "synchronized", "void", "reconfigure", "(", "Properties", "props", ")", "{", "// First isolate any property that is different from the immutable", "// set of original initialization properties", "Properties", "newOverrideProps", "=", "new", "Properties", "(", ")", ";", ...
Set a snapshot of all LOG4J properties and reconfigure if properties have been changed. @param props Complete set of ALL log4j configuration properties including all appenders and log level overrides
[ "Set", "a", "snapshot", "of", "all", "LOG4J", "properties", "and", "reconfigure", "if", "properties", "have", "been", "changed", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/LoggingConfiguration.java#L345-L364
55,505
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/LoggingConfiguration.java
LoggingConfiguration.reConfigureAsynchronously
private void reConfigureAsynchronously() { refreshCount.incrementAndGet(); if (pendingRefreshes.incrementAndGet() == 1) { executorPool.submit(new Runnable() { @Override public void run() { do { try { ...
java
private void reConfigureAsynchronously() { refreshCount.incrementAndGet(); if (pendingRefreshes.incrementAndGet() == 1) { executorPool.submit(new Runnable() { @Override public void run() { do { try { ...
[ "private", "void", "reConfigureAsynchronously", "(", ")", "{", "refreshCount", ".", "incrementAndGet", "(", ")", ";", "if", "(", "pendingRefreshes", ".", "incrementAndGet", "(", ")", "==", "1", ")", "{", "executorPool", ".", "submit", "(", "new", "Runnable", ...
Refresh the configuration asynchronously
[ "Refresh", "the", "configuration", "asynchronously" ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/LoggingConfiguration.java#L369-L388
55,506
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/LoggingConfiguration.java
LoggingConfiguration.reconfigure
private void reconfigure() throws ConfigurationException, FileNotFoundException { Properties consolidatedProps = getConsolidatedProperties(); logger.info("The root category for log4j.rootCategory now is {}", consolidatedProps.getProperty(LOG4J_ROOT_CATEGORY)); logger.info("The root cate...
java
private void reconfigure() throws ConfigurationException, FileNotFoundException { Properties consolidatedProps = getConsolidatedProperties(); logger.info("The root category for log4j.rootCategory now is {}", consolidatedProps.getProperty(LOG4J_ROOT_CATEGORY)); logger.info("The root cate...
[ "private", "void", "reconfigure", "(", ")", "throws", "ConfigurationException", ",", "FileNotFoundException", "{", "Properties", "consolidatedProps", "=", "getConsolidatedProperties", "(", ")", ";", "logger", ".", "info", "(", "\"The root category for log4j.rootCategory now...
Reconfigure log4j at run-time. @param name - The name of the property that changed @param value - The new value of the property @throws FileNotFoundException @throws ConfigurationException
[ "Reconfigure", "log4j", "at", "run", "-", "time", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/LoggingConfiguration.java#L408-L434
55,507
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/LoggingConfiguration.java
LoggingConfiguration.configureLog4j
private void configureLog4j(Properties props) throws ConfigurationException, FileNotFoundException { if (blitz4jConfig.shouldUseLockFree() && (props.getProperty(LOG4J_LOGGER_FACTORY) == null)) { props.setProperty(LOG4J_LOGGER_FACTORY, LOG4J_FACTORY_IMPL); } convertConfiguredAppenders...
java
private void configureLog4j(Properties props) throws ConfigurationException, FileNotFoundException { if (blitz4jConfig.shouldUseLockFree() && (props.getProperty(LOG4J_LOGGER_FACTORY) == null)) { props.setProperty(LOG4J_LOGGER_FACTORY, LOG4J_FACTORY_IMPL); } convertConfiguredAppenders...
[ "private", "void", "configureLog4j", "(", "Properties", "props", ")", "throws", "ConfigurationException", ",", "FileNotFoundException", "{", "if", "(", "blitz4jConfig", ".", "shouldUseLockFree", "(", ")", "&&", "(", "props", ".", "getProperty", "(", "LOG4J_LOGGER_FA...
Configure log4j with the given properties. @param props The properties that needs to be configured for log4j @throws ConfigurationException @throws FileNotFoundException
[ "Configure", "log4j", "with", "the", "given", "properties", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/LoggingConfiguration.java#L444-L452
55,508
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/LoggingConfiguration.java
LoggingConfiguration.closeNonexistingAsyncAppenders
private void closeNonexistingAsyncAppenders() { org.apache.log4j.Logger rootLogger = LogManager.getRootLogger(); if (NFLockFreeLogger.class.isInstance(rootLogger)) { ((NFLockFreeLogger)rootLogger).reconcileAppenders(); } Enumeration enums = LogManager.getCurrentLoggers(); ...
java
private void closeNonexistingAsyncAppenders() { org.apache.log4j.Logger rootLogger = LogManager.getRootLogger(); if (NFLockFreeLogger.class.isInstance(rootLogger)) { ((NFLockFreeLogger)rootLogger).reconcileAppenders(); } Enumeration enums = LogManager.getCurrentLoggers(); ...
[ "private", "void", "closeNonexistingAsyncAppenders", "(", ")", "{", "org", ".", "apache", ".", "log4j", ".", "Logger", "rootLogger", "=", "LogManager", ".", "getRootLogger", "(", ")", ";", "if", "(", "NFLockFreeLogger", ".", "class", ".", "isInstance", "(", ...
Closes any asynchronous appenders that were not removed during configuration.
[ "Closes", "any", "asynchronous", "appenders", "that", "were", "not", "removed", "during", "configuration", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/LoggingConfiguration.java#L541-L553
55,509
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/LoggerCache.java
LoggerCache.getOrCreateLogger
public Logger getOrCreateLogger(String clazz) { Logger logger = appenderLoggerMap.get(clazz); if (logger == null) { // If multiple threads do the puts, that is fine as it is a one time thing logger = Logger.getLogger(clazz); appenderLoggerMap.put(clazz, logger); } r...
java
public Logger getOrCreateLogger(String clazz) { Logger logger = appenderLoggerMap.get(clazz); if (logger == null) { // If multiple threads do the puts, that is fine as it is a one time thing logger = Logger.getLogger(clazz); appenderLoggerMap.put(clazz, logger); } r...
[ "public", "Logger", "getOrCreateLogger", "(", "String", "clazz", ")", "{", "Logger", "logger", "=", "appenderLoggerMap", ".", "get", "(", "clazz", ")", ";", "if", "(", "logger", "==", "null", ")", "{", "// If multiple threads do the puts, that is fine as it is a one...
Get the logger to be used for the given class. @param clazz - The class for which the logger needs to be returned @return- The log4j logger object
[ "Get", "the", "logger", "to", "be", "used", "for", "the", "given", "class", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/LoggerCache.java#L53-L61
55,510
Netflix/blitz4j
src/main/java/com/netflix/logging/messaging/MessageBatcher.java
MessageBatcher.setProcessorMaxThreads
public void setProcessorMaxThreads(int maxThreads) { if (processor.getCorePoolSize() > maxThreads) { processor.setCorePoolSize(maxThreads); } processor.setMaximumPoolSize(maxThreads); }
java
public void setProcessorMaxThreads(int maxThreads) { if (processor.getCorePoolSize() > maxThreads) { processor.setCorePoolSize(maxThreads); } processor.setMaximumPoolSize(maxThreads); }
[ "public", "void", "setProcessorMaxThreads", "(", "int", "maxThreads", ")", "{", "if", "(", "processor", ".", "getCorePoolSize", "(", ")", ">", "maxThreads", ")", "{", "processor", ".", "setCorePoolSize", "(", "maxThreads", ")", ";", "}", "processor", ".", "s...
Set the max threads for the processors @param maxThreads - max threads that can be launched for processing
[ "Set", "the", "max", "threads", "for", "the", "processors" ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/logging/messaging/MessageBatcher.java#L192-L197
55,511
Netflix/blitz4j
src/main/java/com/netflix/logging/messaging/MessageBatcher.java
MessageBatcher.process
public boolean process(T message) { // If this batcher has been shutdown, do not accept any more messages if (isShutDown) { return false; } try { queueSizeTracer.record(queue.size()); } catch (Throwable ignored) { } if (!queue.offer(messag...
java
public boolean process(T message) { // If this batcher has been shutdown, do not accept any more messages if (isShutDown) { return false; } try { queueSizeTracer.record(queue.size()); } catch (Throwable ignored) { } if (!queue.offer(messag...
[ "public", "boolean", "process", "(", "T", "message", ")", "{", "// If this batcher has been shutdown, do not accept any more messages", "if", "(", "isShutDown", ")", "{", "return", "false", ";", "}", "try", "{", "queueSizeTracer", ".", "record", "(", "queue", ".", ...
Processes the message sent to the batcher. This method just writes the message to the queue and returns immediately. If the queue is full, the messages are dropped immediately and corresponding counter is incremented. @param message - The message to be processed @return boolean - true if the message is queued for proc...
[ "Processes", "the", "message", "sent", "to", "the", "batcher", ".", "This", "method", "just", "writes", "the", "message", "to", "the", "queue", "and", "returns", "immediately", ".", "If", "the", "queue", "is", "full", "the", "messages", "are", "dropped", "...
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/logging/messaging/MessageBatcher.java#L219-L236
55,512
Netflix/blitz4j
src/main/java/com/netflix/logging/messaging/MessageBatcher.java
MessageBatcher.processSync
public void processSync(T message) { // If this batcher has been shutdown, do not accept any more messages if (isShutDown) { return; } try { queueSizeTracer.record(queue.size()); } catch (Throwable ignored) { } try { Stopwatch...
java
public void processSync(T message) { // If this batcher has been shutdown, do not accept any more messages if (isShutDown) { return; } try { queueSizeTracer.record(queue.size()); } catch (Throwable ignored) { } try { Stopwatch...
[ "public", "void", "processSync", "(", "T", "message", ")", "{", "// If this batcher has been shutdown, do not accept any more messages", "if", "(", "isShutDown", ")", "{", "return", ";", "}", "try", "{", "queueSizeTracer", ".", "record", "(", "queue", ".", "size", ...
Processes the message sent to the batcher. This method tries to write to the queue. If the queue is full, the send blocks and waits for the available space. @param message - The message to be processed
[ "Processes", "the", "message", "sent", "to", "the", "batcher", ".", "This", "method", "tries", "to", "write", "to", "the", "queue", ".", "If", "the", "queue", "is", "full", "the", "send", "blocks", "and", "waits", "for", "the", "available", "space", "." ...
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/logging/messaging/MessageBatcher.java#L246-L265
55,513
Netflix/blitz4j
src/main/java/com/netflix/logging/messaging/MessageBatcher.java
MessageBatcher.process
public void process(List<T> objects) { for (T message : objects) { // If this batcher has been shutdown, do not accept any more // messages if (isShutDown) { return; } process(message); } }
java
public void process(List<T> objects) { for (T message : objects) { // If this batcher has been shutdown, do not accept any more // messages if (isShutDown) { return; } process(message); } }
[ "public", "void", "process", "(", "List", "<", "T", ">", "objects", ")", "{", "for", "(", "T", "message", ":", "objects", ")", "{", "// If this batcher has been shutdown, do not accept any more", "// messages", "if", "(", "isShutDown", ")", "{", "return", ";", ...
Processes the messages sent to the batcher. This method just writes the message to the queue and returns immediately. If the queue is full, the messages are dropped immediately and corresponding counter is incremented. @param message - The messages to be processed
[ "Processes", "the", "messages", "sent", "to", "the", "batcher", ".", "This", "method", "just", "writes", "the", "message", "to", "the", "queue", "and", "returns", "immediately", ".", "If", "the", "queue", "is", "full", "the", "messages", "are", "dropped", ...
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/logging/messaging/MessageBatcher.java#L276-L285
55,514
Netflix/blitz4j
src/main/java/com/netflix/logging/messaging/MessageBatcher.java
MessageBatcher.getSize
@Monitor(name = "batcherQueueSize", type = DataSourceType.GAUGE) public int getSize() { if (queue != null) { return queue.size(); } else { return 0; } }
java
@Monitor(name = "batcherQueueSize", type = DataSourceType.GAUGE) public int getSize() { if (queue != null) { return queue.size(); } else { return 0; } }
[ "@", "Monitor", "(", "name", "=", "\"batcherQueueSize\"", ",", "type", "=", "DataSourceType", ".", "GAUGE", ")", "public", "int", "getSize", "(", ")", "{", "if", "(", "queue", "!=", "null", ")", "{", "return", "queue", ".", "size", "(", ")", ";", "}"...
The size of the the queue in which the messages are batches @return- size of the queue
[ "The", "size", "of", "the", "the", "queue", "in", "which", "the", "messages", "are", "batches" ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/logging/messaging/MessageBatcher.java#L518-L525
55,515
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/NFAppenderAttachableImpl.java
NFAppenderAttachableImpl.reconcileAppenders
public void reconcileAppenders() { for (Appender appender : appenderList) { if (!configuredAppenderList.contains(appender.getName())) { appender.close(); appenderList.remove(appender); } } }
java
public void reconcileAppenders() { for (Appender appender : appenderList) { if (!configuredAppenderList.contains(appender.getName())) { appender.close(); appenderList.remove(appender); } } }
[ "public", "void", "reconcileAppenders", "(", ")", "{", "for", "(", "Appender", "appender", ":", "appenderList", ")", "{", "if", "(", "!", "configuredAppenderList", ".", "contains", "(", "appender", ".", "getName", "(", ")", ")", ")", "{", "appender", ".", ...
Reconciles the appender list after configuration to ensure that the asynchrnous appenders are not left over after the configuration. This is needed because the appenders are not cleaned out completely during configuration for it to retain the ability to not messages.
[ "Reconciles", "the", "appender", "list", "after", "configuration", "to", "ensure", "that", "the", "asynchrnous", "appenders", "are", "not", "left", "over", "after", "the", "configuration", ".", "This", "is", "needed", "because", "the", "appenders", "are", "not",...
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/NFAppenderAttachableImpl.java#L230-L237
55,516
Netflix/blitz4j
src/main/java/com/netflix/logging/messaging/BatcherFactory.java
BatcherFactory.getBatcher
public static MessageBatcher getBatcher(String name) { MessageBatcher batcher = batcherMap.get(name); return batcher; }
java
public static MessageBatcher getBatcher(String name) { MessageBatcher batcher = batcherMap.get(name); return batcher; }
[ "public", "static", "MessageBatcher", "getBatcher", "(", "String", "name", ")", "{", "MessageBatcher", "batcher", "=", "batcherMap", ".", "get", "(", "name", ")", ";", "return", "batcher", ";", "}" ]
Get a batcher by name @param name - The name of the batcher @return - the batcher associated with the name
[ "Get", "a", "batcher", "by", "name" ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/logging/messaging/BatcherFactory.java#L49-L52
55,517
Netflix/blitz4j
src/main/java/com/netflix/logging/messaging/BatcherFactory.java
BatcherFactory.createBatcher
public static MessageBatcher createBatcher(String name, MessageProcessor processor) { MessageBatcher batcher = batcherMap.get(name); if (batcher == null) { synchronized (BatcherFactory.class) { batcher = batcherMap.get(name); if (batcher == null) { batcher = new MessageBatcher(name, processor); ...
java
public static MessageBatcher createBatcher(String name, MessageProcessor processor) { MessageBatcher batcher = batcherMap.get(name); if (batcher == null) { synchronized (BatcherFactory.class) { batcher = batcherMap.get(name); if (batcher == null) { batcher = new MessageBatcher(name, processor); ...
[ "public", "static", "MessageBatcher", "createBatcher", "(", "String", "name", ",", "MessageProcessor", "processor", ")", "{", "MessageBatcher", "batcher", "=", "batcherMap", ".", "get", "(", "name", ")", ";", "if", "(", "batcher", "==", "null", ")", "{", "sy...
Creates the batcher. The user needs to make sure another batcher already exists before they create one. @param name - The name of the batcher to be created @param processor - The user override for actions to be performed on the batched messages. @return
[ "Creates", "the", "batcher", ".", "The", "user", "needs", "to", "make", "sure", "another", "batcher", "already", "exists", "before", "they", "create", "one", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/logging/messaging/BatcherFactory.java#L63-L76
55,518
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/LoggingContext.java
LoggingContext.getStackTraceElement
public StackTraceElement getStackTraceElement(Class stackClass) { Stopwatch s = stackTraceTimer.start(); Throwable t = new Throwable(); StackTraceElement[] stArray = t.getStackTrace(); int stackSize = stArray.length; StackTraceElement st = null; for (int i = 0; i < stack...
java
public StackTraceElement getStackTraceElement(Class stackClass) { Stopwatch s = stackTraceTimer.start(); Throwable t = new Throwable(); StackTraceElement[] stArray = t.getStackTrace(); int stackSize = stArray.length; StackTraceElement st = null; for (int i = 0; i < stack...
[ "public", "StackTraceElement", "getStackTraceElement", "(", "Class", "stackClass", ")", "{", "Stopwatch", "s", "=", "stackTraceTimer", ".", "start", "(", ")", ";", "Throwable", "t", "=", "new", "Throwable", "(", ")", ";", "StackTraceElement", "[", "]", "stArra...
Gets the starting calling stack trace element of a given stack which matches the given class name. Given the wrapper class name, the match continues until the last stack trace element of the wrapper class is matched. @param stackClass - The class to be matched for. Get the last matching class down the stack @return - ...
[ "Gets", "the", "starting", "calling", "stack", "trace", "element", "of", "a", "given", "stack", "which", "matches", "the", "given", "class", "name", ".", "Given", "the", "wrapper", "class", "name", "the", "match", "continues", "until", "the", "last", "stack"...
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/LoggingContext.java#L82-L103
55,519
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/LoggingContext.java
LoggingContext.getLocationInfo
public LocationInfo getLocationInfo(Class wrapperClassName) { LocationInfo locationInfo = null; try { if (stackLocal.get() == null) { stackLocal.set(this.getStackTraceElement(wrapperClassName)); } locationInfo = new LocationInfo(stackLocal.get().getF...
java
public LocationInfo getLocationInfo(Class wrapperClassName) { LocationInfo locationInfo = null; try { if (stackLocal.get() == null) { stackLocal.set(this.getStackTraceElement(wrapperClassName)); } locationInfo = new LocationInfo(stackLocal.get().getF...
[ "public", "LocationInfo", "getLocationInfo", "(", "Class", "wrapperClassName", ")", "{", "LocationInfo", "locationInfo", "=", "null", ";", "try", "{", "if", "(", "stackLocal", ".", "get", "(", ")", "==", "null", ")", "{", "stackLocal", ".", "set", "(", "th...
Get the location information of the calling class @param wrapperClassName - The wrapper that indicates the caller @return the location information
[ "Get", "the", "location", "information", "of", "the", "calling", "class" ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/LoggingContext.java#L112-L131
55,520
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/LoggingContext.java
LoggingContext.generateLocationInfo
public LocationInfo generateLocationInfo(LoggingEvent event) { // If the event is not the same, clear the cache if (event != loggingEvent.get()) { loggingEvent.set(event); clearLocationInfo(); } LocationInfo locationInfo = null; try { // We sho...
java
public LocationInfo generateLocationInfo(LoggingEvent event) { // If the event is not the same, clear the cache if (event != loggingEvent.get()) { loggingEvent.set(event); clearLocationInfo(); } LocationInfo locationInfo = null; try { // We sho...
[ "public", "LocationInfo", "generateLocationInfo", "(", "LoggingEvent", "event", ")", "{", "// If the event is not the same, clear the cache", "if", "(", "event", "!=", "loggingEvent", ".", "get", "(", ")", ")", "{", "loggingEvent", ".", "set", "(", "event", ")", "...
Generate the location information of the given logging event and cache it. @param event The logging event for which the location information needs to be determined. @return The location info object contains information about the logger.
[ "Generate", "the", "location", "information", "of", "the", "given", "logging", "event", "and", "cache", "it", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/LoggingContext.java#L155-L179
55,521
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/AsyncAppender.java
AsyncAppender.initBatcher
private void initBatcher(String appenderName) { MessageProcessor<LoggingEvent> messageProcessor = new MessageProcessor<LoggingEvent>() { @Override public void process(List<LoggingEvent> objects) { processLoggingEvents(objects); } }; String batc...
java
private void initBatcher(String appenderName) { MessageProcessor<LoggingEvent> messageProcessor = new MessageProcessor<LoggingEvent>() { @Override public void process(List<LoggingEvent> objects) { processLoggingEvents(objects); } }; String batc...
[ "private", "void", "initBatcher", "(", "String", "appenderName", ")", "{", "MessageProcessor", "<", "LoggingEvent", ">", "messageProcessor", "=", "new", "MessageProcessor", "<", "LoggingEvent", ">", "(", ")", "{", "@", "Override", "public", "void", "process", "(...
Initialize the batcher that stores the messages and calls the underlying appenders. @param appenderName - The name of the appender for which the batcher is created
[ "Initialize", "the", "batcher", "that", "stores", "the", "messages", "and", "calls", "the", "underlying", "appenders", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/AsyncAppender.java#L140-L152
55,522
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/AsyncAppender.java
AsyncAppender.processLoggingEvents
private void processLoggingEvents(List<LoggingEvent> loggingEvents) { // Lazy initialization of the appender. This is needed because the // original appenders configuration may be available only after the // complete // log4j initialization. while (appenders.getAllAppenders() == ...
java
private void processLoggingEvents(List<LoggingEvent> loggingEvents) { // Lazy initialization of the appender. This is needed because the // original appenders configuration may be available only after the // complete // log4j initialization. while (appenders.getAllAppenders() == ...
[ "private", "void", "processLoggingEvents", "(", "List", "<", "LoggingEvent", ">", "loggingEvents", ")", "{", "// Lazy initialization of the appender. This is needed because the", "// original appenders configuration may be available only after the", "// complete", "// log4j initializatio...
Process the logging events. This is called by the batcher. @param loggingEvents - The logging events to be written to the underlying appender
[ "Process", "the", "logging", "events", ".", "This", "is", "called", "by", "the", "batcher", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/AsyncAppender.java#L160-L216
55,523
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/AsyncAppender.java
AsyncAppender.initAndRegisterCounter
private Counter initAndRegisterCounter(String name) { BasicCounter counter = new BasicCounter(MonitorConfig.builder(name).build()); DefaultMonitorRegistry.getInstance().register(counter); return counter; }
java
private Counter initAndRegisterCounter(String name) { BasicCounter counter = new BasicCounter(MonitorConfig.builder(name).build()); DefaultMonitorRegistry.getInstance().register(counter); return counter; }
[ "private", "Counter", "initAndRegisterCounter", "(", "String", "name", ")", "{", "BasicCounter", "counter", "=", "new", "BasicCounter", "(", "MonitorConfig", ".", "builder", "(", "name", ")", ".", "build", "(", ")", ")", ";", "DefaultMonitorRegistry", ".", "ge...
Construct a new Counter, register it, and then return it. @param name String @return Counter
[ "Construct", "a", "new", "Counter", "register", "it", "and", "then", "return", "it", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/AsyncAppender.java#L330-L334
55,524
Netflix/blitz4j
src/main/java/com/netflix/blitz4j/AsyncAppender.java
AsyncAppender.putInBuffer
private boolean putInBuffer(final LoggingEvent event) { putInBufferCounter.increment(); Stopwatch t = putBufferTimeTracer.start(); boolean hasPut = false; if (batcher.process(event)) { hasPut = true; } else { hasPut = false; } t.stop(); ...
java
private boolean putInBuffer(final LoggingEvent event) { putInBufferCounter.increment(); Stopwatch t = putBufferTimeTracer.start(); boolean hasPut = false; if (batcher.process(event)) { hasPut = true; } else { hasPut = false; } t.stop(); ...
[ "private", "boolean", "putInBuffer", "(", "final", "LoggingEvent", "event", ")", "{", "putInBufferCounter", ".", "increment", "(", ")", ";", "Stopwatch", "t", "=", "putBufferTimeTracer", ".", "start", "(", ")", ";", "boolean", "hasPut", "=", "false", ";", "i...
Puts the logging events to the in-memory buffer. @param event - The event that needs to be put in the buffer. @return - true, if the put was successful, false otherwise
[ "Puts", "the", "logging", "events", "to", "the", "in", "-", "memory", "buffer", "." ]
d03aaf4ede238dc204a4420c8d333565f86fc6f2
https://github.com/Netflix/blitz4j/blob/d03aaf4ede238dc204a4420c8d333565f86fc6f2/src/main/java/com/netflix/blitz4j/AsyncAppender.java#L359-L370
55,525
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/EstimatedHistogram.java
EstimatedHistogram.add
public void add(long n) { int index = Arrays.binarySearch(bucketOffsets, n); if (index < 0) { // inexact match, take the first bucket higher than n index = -index - 1; } // else exact match; we're good buckets.incrementAndGet(index); }
java
public void add(long n) { int index = Arrays.binarySearch(bucketOffsets, n); if (index < 0) { // inexact match, take the first bucket higher than n index = -index - 1; } // else exact match; we're good buckets.incrementAndGet(index); }
[ "public", "void", "add", "(", "long", "n", ")", "{", "int", "index", "=", "Arrays", ".", "binarySearch", "(", "bucketOffsets", ",", "n", ")", ";", "if", "(", "index", "<", "0", ")", "{", "// inexact match, take the first bucket higher than n", "index", "=", ...
Increments the count of the bucket closest to n, rounding UP. @param n
[ "Increments", "the", "count", "of", "the", "bucket", "closest", "to", "n", "rounding", "UP", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/EstimatedHistogram.java#L89-L99
55,526
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/ConnectionPoolImpl.java
ConnectionPoolImpl.getConnectionForOperation
public <R> Connection<CL> getConnectionForOperation(BaseOperation<CL, R> baseOperation) { return selectionStrategy.getConnection(baseOperation, cpConfiguration.getMaxTimeoutWhenExhausted(), TimeUnit.MILLISECONDS); }
java
public <R> Connection<CL> getConnectionForOperation(BaseOperation<CL, R> baseOperation) { return selectionStrategy.getConnection(baseOperation, cpConfiguration.getMaxTimeoutWhenExhausted(), TimeUnit.MILLISECONDS); }
[ "public", "<", "R", ">", "Connection", "<", "CL", ">", "getConnectionForOperation", "(", "BaseOperation", "<", "CL", ",", "R", ">", "baseOperation", ")", "{", "return", "selectionStrategy", ".", "getConnection", "(", "baseOperation", ",", "cpConfiguration", ".",...
Use with EXTREME CAUTION. Connection that is borrowed must be returned, else we will have connection pool exhaustion @param baseOperation @return
[ "Use", "with", "EXTREME", "CAUTION", ".", "Connection", "that", "is", "borrowed", "must", "be", "returned", "else", "we", "will", "have", "connection", "pool", "exhaustion" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/ConnectionPoolImpl.java#L454-L457
55,527
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HostSelectionWithFallback.java
HostSelectionWithFallback.getConnectionForTokenOnRackNoFallback
private Connection<CL> getConnectionForTokenOnRackNoFallback(BaseOperation<CL, ?> op, Long token, String rack, int duration, TimeUnit unit, RetryPolicy retry) throws NoAvailableHostsException, PoolExhaustedException, PoolTimeoutException, PoolOfflineException { DynoConnectException lastEx = null; ...
java
private Connection<CL> getConnectionForTokenOnRackNoFallback(BaseOperation<CL, ?> op, Long token, String rack, int duration, TimeUnit unit, RetryPolicy retry) throws NoAvailableHostsException, PoolExhaustedException, PoolTimeoutException, PoolOfflineException { DynoConnectException lastEx = null; ...
[ "private", "Connection", "<", "CL", ">", "getConnectionForTokenOnRackNoFallback", "(", "BaseOperation", "<", "CL", ",", "?", ">", "op", ",", "Long", "token", ",", "String", "rack", ",", "int", "duration", ",", "TimeUnit", "unit", ",", "RetryPolicy", "retry", ...
Should be called when a connection is required on that particular zone with no fall backs what so ever
[ "Should", "be", "called", "when", "a", "connection", "is", "required", "on", "that", "particular", "zone", "with", "no", "fall", "backs", "what", "so", "ever" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HostSelectionWithFallback.java#L159-L184
55,528
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HostSelectionWithFallback.java
HostSelectionWithFallback.initWithHosts
public void initWithHosts(Map<Host, HostConnectionPool<CL>> hPools) { // Get the list of tokens for these hosts //tokenSupplier.initWithHosts(hPools.keySet()); List<HostToken> allHostTokens = tokenSupplier.getTokens(hPools.keySet()); Map<HostToken, HostConnectionPool<CL>> tokenPoolMap = new HashMap<HostToken, ...
java
public void initWithHosts(Map<Host, HostConnectionPool<CL>> hPools) { // Get the list of tokens for these hosts //tokenSupplier.initWithHosts(hPools.keySet()); List<HostToken> allHostTokens = tokenSupplier.getTokens(hPools.keySet()); Map<HostToken, HostConnectionPool<CL>> tokenPoolMap = new HashMap<HostToken, ...
[ "public", "void", "initWithHosts", "(", "Map", "<", "Host", ",", "HostConnectionPool", "<", "CL", ">", ">", "hPools", ")", "{", "// Get the list of tokens for these hosts", "//tokenSupplier.initWithHosts(hPools.keySet());", "List", "<", "HostToken", ">", "allHostTokens", ...
hPools comes from discovery. @param hPools
[ "hPools", "comes", "from", "discovery", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HostSelectionWithFallback.java#L345-L384
55,529
Netflix/dyno
dyno-jedis/src/main/java/com/netflix/dyno/jedis/DynoJedisPipeline.java
DynoJedisPipeline.checkKey
private void checkKey(final byte[] key) { if (theBinaryKey.get() != null) { verifyKey(key); } else { boolean success = theBinaryKey.compareAndSet(null, key); if (!success) { // someone already beat us to it. that's fine, just verify // that the key is the same verifyKey(key); } else { pi...
java
private void checkKey(final byte[] key) { if (theBinaryKey.get() != null) { verifyKey(key); } else { boolean success = theBinaryKey.compareAndSet(null, key); if (!success) { // someone already beat us to it. that's fine, just verify // that the key is the same verifyKey(key); } else { pi...
[ "private", "void", "checkKey", "(", "final", "byte", "[", "]", "key", ")", "{", "if", "(", "theBinaryKey", ".", "get", "(", ")", "!=", "null", ")", "{", "verifyKey", "(", "key", ")", ";", "}", "else", "{", "boolean", "success", "=", "theBinaryKey", ...
Checks that a pipeline is associated with a single key. Binary keys do not support hashtags. @param key
[ "Checks", "that", "a", "pipeline", "is", "associated", "with", "a", "single", "key", ".", "Binary", "keys", "do", "not", "support", "hashtags", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-jedis/src/main/java/com/netflix/dyno/jedis/DynoJedisPipeline.java#L175-L188
55,530
Netflix/dyno
dyno-jedis/src/main/java/com/netflix/dyno/jedis/DynoJedisPipeline.java
DynoJedisPipeline.checkKey
private void checkKey(final String key) { /* * Get hashtag from the first host of the active pool We cannot use the * connection object because as of now we have not selected a connection. A * connection is selected based on the key or hashtag respectively. */ String hashtag = connPool.getConfiguration...
java
private void checkKey(final String key) { /* * Get hashtag from the first host of the active pool We cannot use the * connection object because as of now we have not selected a connection. A * connection is selected based on the key or hashtag respectively. */ String hashtag = connPool.getConfiguration...
[ "private", "void", "checkKey", "(", "final", "String", "key", ")", "{", "/*\n\t\t * Get hashtag from the first host of the active pool We cannot use the\n\t\t * connection object because as of now we have not selected a connection. A\n\t\t * connection is selected based on the key or hashtag respe...
Checks that a pipeline is associated with a single key. If there is a hashtag defined in the first host of the connectionpool then we check that first. @param key
[ "Checks", "that", "a", "pipeline", "is", "associated", "with", "a", "single", "key", ".", "If", "there", "is", "a", "hashtag", "defined", "in", "the", "first", "host", "of", "the", "connectionpool", "then", "we", "check", "that", "first", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-jedis/src/main/java/com/netflix/dyno/jedis/DynoJedisPipeline.java#L196-L230
55,531
Netflix/dyno
dyno-jedis/src/main/java/com/netflix/dyno/jedis/DynoJedisPipeline.java
DynoJedisPipeline.verifyKey
private void verifyKey(final String key) { if (!theKey.get().equals(key)) { try { throw new RuntimeException("Must have same key for Redis Pipeline in Dynomite. This key: " + key); } finally { discardPipelineAndReleaseConnection(); } } }
java
private void verifyKey(final String key) { if (!theKey.get().equals(key)) { try { throw new RuntimeException("Must have same key for Redis Pipeline in Dynomite. This key: " + key); } finally { discardPipelineAndReleaseConnection(); } } }
[ "private", "void", "verifyKey", "(", "final", "String", "key", ")", "{", "if", "(", "!", "theKey", ".", "get", "(", ")", ".", "equals", "(", "key", ")", ")", "{", "try", "{", "throw", "new", "RuntimeException", "(", "\"Must have same key for Redis Pipeline...
Verifies key with pipeline key
[ "Verifies", "key", "with", "pipeline", "key" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-jedis/src/main/java/com/netflix/dyno/jedis/DynoJedisPipeline.java#L248-L257
55,532
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java
Murmur2Hash.hash32
public static int hash32(final byte[] data, int length, int seed) { // 'm' and 'r' are mixing constants generated offline. // They're not really 'magic', they just happen to work well. final int m = 0x5bd1e995; final int r = 24; // Initialize the hash to a random value i...
java
public static int hash32(final byte[] data, int length, int seed) { // 'm' and 'r' are mixing constants generated offline. // They're not really 'magic', they just happen to work well. final int m = 0x5bd1e995; final int r = 24; // Initialize the hash to a random value i...
[ "public", "static", "int", "hash32", "(", "final", "byte", "[", "]", "data", ",", "int", "length", ",", "int", "seed", ")", "{", "// 'm' and 'r' are mixing constants generated offline.", "// They're not really 'magic', they just happen to work well.", "final", "int", "m",...
Generates 32 bit hash from byte array of the given length and seed. @param data byte array to hash @param length length of the array to hash @param seed initial seed value @return 32 bit hash of the given array
[ "Generates", "32", "bit", "hash", "from", "byte", "array", "of", "the", "given", "length", "and", "seed", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java#L48-L82
55,533
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java
Murmur2Hash.hash32
public static int hash32(final String text) { final byte[] bytes = text.getBytes(); return hash32(bytes, bytes.length); }
java
public static int hash32(final String text) { final byte[] bytes = text.getBytes(); return hash32(bytes, bytes.length); }
[ "public", "static", "int", "hash32", "(", "final", "String", "text", ")", "{", "final", "byte", "[", "]", "bytes", "=", "text", ".", "getBytes", "(", ")", ";", "return", "hash32", "(", "bytes", ",", "bytes", ".", "length", ")", ";", "}" ]
Generates 32 bit hash from a string. @param text string to hash @return 32 bit hash of the given string
[ "Generates", "32", "bit", "hash", "from", "a", "string", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java#L101-L104
55,534
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java
Murmur2Hash.hash32
public static int hash32(final String text, int from, int length) { return hash32(text.substring( from, from+length)); }
java
public static int hash32(final String text, int from, int length) { return hash32(text.substring( from, from+length)); }
[ "public", "static", "int", "hash32", "(", "final", "String", "text", ",", "int", "from", ",", "int", "length", ")", "{", "return", "hash32", "(", "text", ".", "substring", "(", "from", ",", "from", "+", "length", ")", ")", ";", "}" ]
Generates 32 bit hash from a substring. @param text string to hash @param from starting index @param length length of the substring to hash @return 32 bit hash of the given string
[ "Generates", "32", "bit", "hash", "from", "a", "substring", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java#L114-L116
55,535
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java
Murmur2Hash.hash64
public static long hash64(final String text) { final byte[] bytes = text.getBytes(); return hash64(bytes, bytes.length); }
java
public static long hash64(final String text) { final byte[] bytes = text.getBytes(); return hash64(bytes, bytes.length); }
[ "public", "static", "long", "hash64", "(", "final", "String", "text", ")", "{", "final", "byte", "[", "]", "bytes", "=", "text", ".", "getBytes", "(", ")", ";", "return", "hash64", "(", "bytes", ",", "bytes", ".", "length", ")", ";", "}" ]
Generates 64 bit hash from a string. @param text string to hash @return 64 bit hash of the given string
[ "Generates", "64", "bit", "hash", "from", "a", "string", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java#L184-L187
55,536
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java
Murmur2Hash.hash64
public static long hash64(final String text, int from, int length) { return hash64(text.substring( from, from+length)); }
java
public static long hash64(final String text, int from, int length) { return hash64(text.substring( from, from+length)); }
[ "public", "static", "long", "hash64", "(", "final", "String", "text", ",", "int", "from", ",", "int", "length", ")", "{", "return", "hash64", "(", "text", ".", "substring", "(", "from", ",", "from", "+", "length", ")", ")", ";", "}" ]
Generates 64 bit hash from a substring. @param text string to hash @param from starting index @param length length of the substring to hash @return 64 bit hash of the given array
[ "Generates", "64", "bit", "hash", "from", "a", "substring", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java#L197-L199
55,537
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java
ZipUtils.compressBytesNonBase64
public static byte[] compressBytesNonBase64(byte[] value) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(value.length); try (GZIPOutputStream gos = new GZIPOutputStream(baos)) { gos.write(value); } byte[] compressed = baos.toByteArray(); b...
java
public static byte[] compressBytesNonBase64(byte[] value) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(value.length); try (GZIPOutputStream gos = new GZIPOutputStream(baos)) { gos.write(value); } byte[] compressed = baos.toByteArray(); b...
[ "public", "static", "byte", "[", "]", "compressBytesNonBase64", "(", "byte", "[", "]", "value", ")", "throws", "IOException", "{", "ByteArrayOutputStream", "baos", "=", "new", "ByteArrayOutputStream", "(", "value", ".", "length", ")", ";", "try", "(", "GZIPOut...
Encodes the given byte array and then GZIP compresses it. @param value byte array input @return compressed byte array output @throws IOException
[ "Encodes", "the", "given", "byte", "array", "and", "then", "GZIP", "compresses", "it", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java#L59-L67
55,538
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java
ZipUtils.decompressBytesNonBase64
public static byte[] decompressBytesNonBase64(byte[] compressed) throws IOException { ByteArrayInputStream is = new ByteArrayInputStream(compressed); try (InputStream gis = new GZIPInputStream(is)) { return IOUtils.toByteArray(gis); } }
java
public static byte[] decompressBytesNonBase64(byte[] compressed) throws IOException { ByteArrayInputStream is = new ByteArrayInputStream(compressed); try (InputStream gis = new GZIPInputStream(is)) { return IOUtils.toByteArray(gis); } }
[ "public", "static", "byte", "[", "]", "decompressBytesNonBase64", "(", "byte", "[", "]", "compressed", ")", "throws", "IOException", "{", "ByteArrayInputStream", "is", "=", "new", "ByteArrayInputStream", "(", "compressed", ")", ";", "try", "(", "InputStream", "g...
Decompresses the given byte array without transforming it into a String @param compressed byte array input @return decompressed data in a byte array @throws IOException
[ "Decompresses", "the", "given", "byte", "array", "without", "transforming", "it", "into", "a", "String" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java#L76-L81
55,539
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java
ZipUtils.decompressStringNonBase64
public static String decompressStringNonBase64(byte[] compressed) throws IOException { ByteArrayInputStream is = new ByteArrayInputStream(compressed); try (InputStream gis = new GZIPInputStream(is)) { return new String(IOUtils.toByteArray(gis), StandardCharsets.UTF_8); } }
java
public static String decompressStringNonBase64(byte[] compressed) throws IOException { ByteArrayInputStream is = new ByteArrayInputStream(compressed); try (InputStream gis = new GZIPInputStream(is)) { return new String(IOUtils.toByteArray(gis), StandardCharsets.UTF_8); } }
[ "public", "static", "String", "decompressStringNonBase64", "(", "byte", "[", "]", "compressed", ")", "throws", "IOException", "{", "ByteArrayInputStream", "is", "=", "new", "ByteArrayInputStream", "(", "compressed", ")", ";", "try", "(", "InputStream", "gis", "=",...
Decompresses the given byte array @param compressed byte array input @return decompressed data in string format @throws IOException
[ "Decompresses", "the", "given", "byte", "array" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java#L90-L95
55,540
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java
ZipUtils.compressStringToBase64String
public static String compressStringToBase64String(String value) throws IOException { return new String(Base64.encode(compressString(value)), StandardCharsets.UTF_8); }
java
public static String compressStringToBase64String(String value) throws IOException { return new String(Base64.encode(compressString(value)), StandardCharsets.UTF_8); }
[ "public", "static", "String", "compressStringToBase64String", "(", "String", "value", ")", "throws", "IOException", "{", "return", "new", "String", "(", "Base64", ".", "encode", "(", "compressString", "(", "value", ")", ")", ",", "StandardCharsets", ".", "UTF_8"...
Encodes the given string with Base64 encoding and then GZIP compresses it. Returns result as a Base64 encoded string. @param value input String @return Base64 encoded compressed String @throws IOException
[ "Encodes", "the", "given", "string", "with", "Base64", "encoding", "and", "then", "GZIP", "compresses", "it", ".", "Returns", "result", "as", "a", "Base64", "encoded", "string", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java#L105-L107
55,541
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java
ZipUtils.decompressString
public static String decompressString(byte[] compressed) throws IOException { ByteArrayInputStream is = new ByteArrayInputStream(compressed); try (InputStream gis = new GZIPInputStream(is)) { return new String(Base64.decode(IOUtils.toByteArray(gis)), StandardCharsets.UTF_8); } }
java
public static String decompressString(byte[] compressed) throws IOException { ByteArrayInputStream is = new ByteArrayInputStream(compressed); try (InputStream gis = new GZIPInputStream(is)) { return new String(Base64.decode(IOUtils.toByteArray(gis)), StandardCharsets.UTF_8); } }
[ "public", "static", "String", "decompressString", "(", "byte", "[", "]", "compressed", ")", "throws", "IOException", "{", "ByteArrayInputStream", "is", "=", "new", "ByteArrayInputStream", "(", "compressed", ")", ";", "try", "(", "InputStream", "gis", "=", "new",...
Decompresses the given byte array and decodes with Base64 decoding @param compressed byte array input @return decompressed data in string format @throws IOException
[ "Decompresses", "the", "given", "byte", "array", "and", "decodes", "with", "Base64", "decoding" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java#L116-L121
55,542
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java
ZipUtils.decompressFromBase64String
public static String decompressFromBase64String(String compressed) throws IOException { return decompressString(Base64.decode(compressed.getBytes(StandardCharsets.UTF_8))); }
java
public static String decompressFromBase64String(String compressed) throws IOException { return decompressString(Base64.decode(compressed.getBytes(StandardCharsets.UTF_8))); }
[ "public", "static", "String", "decompressFromBase64String", "(", "String", "compressed", ")", "throws", "IOException", "{", "return", "decompressString", "(", "Base64", ".", "decode", "(", "compressed", ".", "getBytes", "(", "StandardCharsets", ".", "UTF_8", ")", ...
Given a Base64 encoded String, decompresses it. @param compressed Compressed String @return decompressed String @throws IOException
[ "Given", "a", "Base64", "encoded", "String", "decompresses", "it", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java#L130-L132
55,543
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java
ZipUtils.isCompressed
public static boolean isCompressed(byte[] bytes) throws IOException { return bytes != null && bytes.length >= 2 && bytes[0] == (byte) (GZIPInputStream.GZIP_MAGIC) && bytes[1] == (byte) (GZIPInputStream.GZIP_MAGIC >> 8); }
java
public static boolean isCompressed(byte[] bytes) throws IOException { return bytes != null && bytes.length >= 2 && bytes[0] == (byte) (GZIPInputStream.GZIP_MAGIC) && bytes[1] == (byte) (GZIPInputStream.GZIP_MAGIC >> 8); }
[ "public", "static", "boolean", "isCompressed", "(", "byte", "[", "]", "bytes", ")", "throws", "IOException", "{", "return", "bytes", "!=", "null", "&&", "bytes", ".", "length", ">=", "2", "&&", "bytes", "[", "0", "]", "==", "(", "byte", ")", "(", "GZ...
Determines if a byte array is compressed. The java.util.zip GZip implementation does not expose the GZip header so it is difficult to determine if a string is compressed. @param bytes an array of bytes @return true if the array is compressed or false otherwise @throws java.io.IOException if the byte array couldn't be ...
[ "Determines", "if", "a", "byte", "array", "is", "compressed", ".", "The", "java", ".", "util", ".", "zip", "GZip", "implementation", "does", "not", "expose", "the", "GZip", "header", "so", "it", "is", "difficult", "to", "determine", "if", "a", "string", ...
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java#L143-L146
55,544
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java
ZipUtils.isCompressed
public static boolean isCompressed(InputStream inputStream) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); byte[] data = new byte[2]; int nRead = inputStream.read(data, 0, 2); buffer.write(data, 0, nRead); buffer.flush(); return isComp...
java
public static boolean isCompressed(InputStream inputStream) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); byte[] data = new byte[2]; int nRead = inputStream.read(data, 0, 2); buffer.write(data, 0, nRead); buffer.flush(); return isComp...
[ "public", "static", "boolean", "isCompressed", "(", "InputStream", "inputStream", ")", "throws", "IOException", "{", "ByteArrayOutputStream", "buffer", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "byte", "[", "]", "data", "=", "new", "byte", "[", "2", ...
Determines if an InputStream is compressed. The java.util.zip GZip implementation does not expose the GZip header so it is difficult to determine if a string is compressed. @param inputStream an array of bytes @return true if the stream is compressed or false otherwise @throws java.io.IOException if the byte array cou...
[ "Determines", "if", "an", "InputStream", "is", "compressed", ".", "The", "java", ".", "util", ".", "zip", "GZip", "implementation", "does", "not", "expose", "the", "GZip", "header", "so", "it", "is", "difficult", "to", "determine", "if", "a", "string", "is...
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/utils/ZipUtils.java#L157-L167
55,545
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/HostStatusTracker.java
HostStatusTracker.inactiveSetChanged
public boolean inactiveSetChanged(Collection<Host> hostsUp, Collection<Host> hostsDown) { boolean newInactiveHostsFound = false; // Check for condition 1. for (Host hostDown : hostsDown) { if (activeHosts.contains(hostDown)) { newInactiveHostsFound = true; break; } } // Check for condi...
java
public boolean inactiveSetChanged(Collection<Host> hostsUp, Collection<Host> hostsDown) { boolean newInactiveHostsFound = false; // Check for condition 1. for (Host hostDown : hostsDown) { if (activeHosts.contains(hostDown)) { newInactiveHostsFound = true; break; } } // Check for condi...
[ "public", "boolean", "inactiveSetChanged", "(", "Collection", "<", "Host", ">", "hostsUp", ",", "Collection", "<", "Host", ">", "hostsDown", ")", "{", "boolean", "newInactiveHostsFound", "=", "false", ";", "// Check for condition 1. ", "for", "(", "Host", "hostDow...
This check is more involved than the active set check. Here we 2 conditions to check for 1. We could have new hosts that were in the active set and have shown up in the inactive set. 2. We can also have the case where hosts from the active set have disappeared and also not in the provided inactive set. This is where w...
[ "This", "check", "is", "more", "involved", "than", "the", "active", "set", "check", ".", "Here", "we", "2", "conditions", "to", "check", "for" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/HostStatusTracker.java#L103-L122
55,546
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/HostStatusTracker.java
HostStatusTracker.computeNewHostStatus
public HostStatusTracker computeNewHostStatus(Collection<Host> hostsUp, Collection<Host> hostsDown) { verifyMutuallyExclusive(hostsUp, hostsDown); Set<Host> nextActiveHosts = new HashSet<Host>(hostsUp); // Get the hosts that are currently down Set<Host> nextInactiveHosts = new HashSet<Host>(hostsDown);...
java
public HostStatusTracker computeNewHostStatus(Collection<Host> hostsUp, Collection<Host> hostsDown) { verifyMutuallyExclusive(hostsUp, hostsDown); Set<Host> nextActiveHosts = new HashSet<Host>(hostsUp); // Get the hosts that are currently down Set<Host> nextInactiveHosts = new HashSet<Host>(hostsDown);...
[ "public", "HostStatusTracker", "computeNewHostStatus", "(", "Collection", "<", "Host", ">", "hostsUp", ",", "Collection", "<", "Host", ">", "hostsDown", ")", "{", "verifyMutuallyExclusive", "(", "hostsUp", ",", "hostsDown", ")", ";", "Set", "<", "Host", ">", "...
Helper method that actually changes the state of the class to reflect the new set of hosts up and down Note that the new HostStatusTracker is returned that holds onto the new state. Calling classes must update their references to use the new HostStatusTracker @param hostsUp @param hostsDown @return
[ "Helper", "method", "that", "actually", "changes", "the", "state", "of", "the", "class", "to", "reflect", "the", "new", "set", "of", "hosts", "up", "and", "down", "Note", "that", "the", "new", "HostStatusTracker", "is", "returned", "that", "holds", "onto", ...
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/HostStatusTracker.java#L154-L195
55,547
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/CircularList.java
CircularList.swapWithList
public void swapWithList(Collection<T> newList) { InnerList newInnerList = new InnerList(newList); ref.set(newInnerList); }
java
public void swapWithList(Collection<T> newList) { InnerList newInnerList = new InnerList(newList); ref.set(newInnerList); }
[ "public", "void", "swapWithList", "(", "Collection", "<", "T", ">", "newList", ")", "{", "InnerList", "newInnerList", "=", "new", "InnerList", "(", "newList", ")", ";", "ref", ".", "set", "(", "newInnerList", ")", ";", "}" ]
Swap the entire inner list with a new list @param newList
[ "Swap", "the", "entire", "inner", "list", "with", "a", "new", "list" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/CircularList.java#L61-L64
55,548
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/CircularList.java
CircularList.addElement
public synchronized void addElement(T element) { List<T> origList = ref.get().list; boolean isPresent = origList.contains(element); if (isPresent) { return; } List<T> newList = new ArrayList<T>(origList); newList.add(element); swapWithList(newList); }
java
public synchronized void addElement(T element) { List<T> origList = ref.get().list; boolean isPresent = origList.contains(element); if (isPresent) { return; } List<T> newList = new ArrayList<T>(origList); newList.add(element); swapWithList(newList); }
[ "public", "synchronized", "void", "addElement", "(", "T", "element", ")", "{", "List", "<", "T", ">", "origList", "=", "ref", ".", "get", "(", ")", ".", "list", ";", "boolean", "isPresent", "=", "origList", ".", "contains", "(", "element", ")", ";", ...
Add an element to the list. This causes the inner list to be swapped out @param element
[ "Add", "an", "element", "to", "the", "list", ".", "This", "causes", "the", "inner", "list", "to", "be", "swapped", "out" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/CircularList.java#L70-L81
55,549
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/CircularList.java
CircularList.removeElement
public synchronized void removeElement(T element) { List<T> origList = ref.get().list; boolean isPresent = origList.contains(element); if (!isPresent) { return; } List<T> newList = new ArrayList<T>(origList); newList.remove(element); swapWithList(newList); }
java
public synchronized void removeElement(T element) { List<T> origList = ref.get().list; boolean isPresent = origList.contains(element); if (!isPresent) { return; } List<T> newList = new ArrayList<T>(origList); newList.remove(element); swapWithList(newList); }
[ "public", "synchronized", "void", "removeElement", "(", "T", "element", ")", "{", "List", "<", "T", ">", "origList", "=", "ref", ".", "get", "(", ")", ".", "list", ";", "boolean", "isPresent", "=", "origList", ".", "contains", "(", "element", ")", ";",...
Remove an element from this list. This causes the inner list to be swapped out @param element
[ "Remove", "an", "element", "from", "this", "list", ".", "This", "causes", "the", "inner", "list", "to", "be", "swapped", "out" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/CircularList.java#L87-L98
55,550
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/CircularList.java
CircularList.getEntireList
public List<T> getEntireList() { InnerList iList = ref.get(); return iList != null ? iList.getList() : null; }
java
public List<T> getEntireList() { InnerList iList = ref.get(); return iList != null ? iList.getList() : null; }
[ "public", "List", "<", "T", ">", "getEntireList", "(", ")", "{", "InnerList", "iList", "=", "ref", ".", "get", "(", ")", ";", "return", "iList", "!=", "null", "?", "iList", ".", "getList", "(", ")", ":", "null", ";", "}" ]
Helpful utility to access the inner list. Must be used with care since the inner list can change. @return List<T>
[ "Helpful", "utility", "to", "access", "the", "inner", "list", ".", "Must", "be", "used", "with", "care", "since", "the", "inner", "list", "can", "change", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/CircularList.java#L104-L107
55,551
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/CircularList.java
CircularList.getSize
public int getSize() { InnerList iList = ref.get(); return iList != null ? iList.getList().size() : 0; }
java
public int getSize() { InnerList iList = ref.get(); return iList != null ? iList.getList().size() : 0; }
[ "public", "int", "getSize", "(", ")", "{", "InnerList", "iList", "=", "ref", ".", "get", "(", ")", ";", "return", "iList", "!=", "null", "?", "iList", ".", "getList", "(", ")", ".", "size", "(", ")", ":", "0", ";", "}" ]
Gets the size of the bounded list underneath. Note that this num can change if the inner list is swapped out. @return
[ "Gets", "the", "size", "of", "the", "bounded", "list", "underneath", ".", "Note", "that", "this", "num", "can", "change", "if", "the", "inner", "list", "is", "swapped", "out", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/CircularList.java#L113-L116
55,552
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur1Hash.java
Murmur1Hash.hash
public static int hash(byte[] data, int offset, int length, int seed) { return hash(ByteBuffer.wrap(data, offset, length), seed); }
java
public static int hash(byte[] data, int offset, int length, int seed) { return hash(ByteBuffer.wrap(data, offset, length), seed); }
[ "public", "static", "int", "hash", "(", "byte", "[", "]", "data", ",", "int", "offset", ",", "int", "length", ",", "int", "seed", ")", "{", "return", "hash", "(", "ByteBuffer", ".", "wrap", "(", "data", ",", "offset", ",", "length", ")", ",", "seed...
Hashes bytes in part of an array. @param data The data to hash. @param offset Where to start munging. @param length How many bytes to process. @param seed The seed to start with. @return The 32-bit hash of the data in question.
[ "Hashes", "bytes", "in", "part", "of", "an", "array", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur1Hash.java#L31-L33
55,553
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur1Hash.java
Murmur1Hash.hash
public static int hash(ByteBuffer buf, int seed) { // save byte order for later restoration ByteOrder byteOrder = buf.order(); buf.order(ByteOrder.LITTLE_ENDIAN); int m = 0x5bd1e995; int r = 24; int h = seed ^ buf.remaining(); while (buf.remaining() >= 4) { int...
java
public static int hash(ByteBuffer buf, int seed) { // save byte order for later restoration ByteOrder byteOrder = buf.order(); buf.order(ByteOrder.LITTLE_ENDIAN); int m = 0x5bd1e995; int r = 24; int h = seed ^ buf.remaining(); while (buf.remaining() >= 4) { int...
[ "public", "static", "int", "hash", "(", "ByteBuffer", "buf", ",", "int", "seed", ")", "{", "// save byte order for later restoration", "ByteOrder", "byteOrder", "=", "buf", ".", "order", "(", ")", ";", "buf", ".", "order", "(", "ByteOrder", ".", "LITTLE_ENDIAN...
Hashes the bytes in a buffer from the current position to the limit. @param buf The bytes to hash. @param seed The seed for the hash. @return The 32 bit murmur hash of the bytes in the buffer.
[ "Hashes", "the", "bytes", "in", "a", "buffer", "from", "the", "current", "position", "to", "the", "limit", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur1Hash.java#L48-L85
55,554
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java
HttpEndpointBasedTokenMapSupplier.getTopologyJsonPayload
@Override public String getTopologyJsonPayload(Set<Host> activeHosts) { int count = NUM_RETRIER_ACROSS_NODES; String response; Exception lastEx = null; do { try { response = getTopologyFromRandomNodeWithRetry(activeHosts); if (response != null) { return response; } } catch (Exception...
java
@Override public String getTopologyJsonPayload(Set<Host> activeHosts) { int count = NUM_RETRIER_ACROSS_NODES; String response; Exception lastEx = null; do { try { response = getTopologyFromRandomNodeWithRetry(activeHosts); if (response != null) { return response; } } catch (Exception...
[ "@", "Override", "public", "String", "getTopologyJsonPayload", "(", "Set", "<", "Host", ">", "activeHosts", ")", "{", "int", "count", "=", "NUM_RETRIER_ACROSS_NODES", ";", "String", "response", ";", "Exception", "lastEx", "=", "null", ";", "do", "{", "try", ...
Tries to get topology information by randomly trying across nodes.
[ "Tries", "to", "get", "topology", "information", "by", "randomly", "trying", "across", "nodes", "." ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java#L82-L110
55,555
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java
HttpEndpointBasedTokenMapSupplier.getRandomHost
public Host getRandomHost(Set<Host> activeHosts) { Random random = new Random(); List<Host> hostsUp = new ArrayList<Host>(CollectionUtils.filter(activeHosts, new Predicate<Host>() { @Override public boolean apply(Host x) { return x.isUp(); } })); return hostsUp.get(random.nextInt(hostsUp.size())...
java
public Host getRandomHost(Set<Host> activeHosts) { Random random = new Random(); List<Host> hostsUp = new ArrayList<Host>(CollectionUtils.filter(activeHosts, new Predicate<Host>() { @Override public boolean apply(Host x) { return x.isUp(); } })); return hostsUp.get(random.nextInt(hostsUp.size())...
[ "public", "Host", "getRandomHost", "(", "Set", "<", "Host", ">", "activeHosts", ")", "{", "Random", "random", "=", "new", "Random", "(", ")", ";", "List", "<", "Host", ">", "hostsUp", "=", "new", "ArrayList", "<", "Host", ">", "(", "CollectionUtils", "...
Finds a random host from the set of active hosts to perform cluster_describe @param activeHosts @return a random host
[ "Finds", "a", "random", "host", "from", "the", "set", "of", "active", "hosts", "to", "perform", "cluster_describe" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java#L156-L168
55,556
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java
HttpEndpointBasedTokenMapSupplier.getTopologyFromRandomNodeWithRetry
private String getTopologyFromRandomNodeWithRetry(Set<Host> activeHosts) { int count = NUM_RETRIES_PER_NODE; String nodeResponse; Exception lastEx; final Host randomHost = getRandomHost(activeHosts); do { try { lastEx = null; nodeResponse = getResponseViaHttp(randomHost.getHostName()); if (node...
java
private String getTopologyFromRandomNodeWithRetry(Set<Host> activeHosts) { int count = NUM_RETRIES_PER_NODE; String nodeResponse; Exception lastEx; final Host randomHost = getRandomHost(activeHosts); do { try { lastEx = null; nodeResponse = getResponseViaHttp(randomHost.getHostName()); if (node...
[ "private", "String", "getTopologyFromRandomNodeWithRetry", "(", "Set", "<", "Host", ">", "activeHosts", ")", "{", "int", "count", "=", "NUM_RETRIES_PER_NODE", ";", "String", "nodeResponse", ";", "Exception", "lastEx", ";", "final", "Host", "randomHost", "=", "getR...
Tries multiple nodes, and it only bubbles up the last node's exception. We want to bubble up the exception in order for the last node to be removed from the connection pool. @param activeHosts @return the topology from cluster_describe
[ "Tries", "multiple", "nodes", "and", "it", "only", "bubbles", "up", "the", "last", "node", "s", "exception", ".", "We", "want", "to", "bubble", "up", "the", "exception", "in", "order", "for", "the", "last", "node", "to", "be", "removed", "from", "the", ...
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/HttpEndpointBasedTokenMapSupplier.java#L178-L209
55,557
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/AbstractTokenMapSupplier.java
AbstractTokenMapSupplier.parseTokenListFromJson
List<HostToken> parseTokenListFromJson(String json) { List<HostToken> hostTokens = new ArrayList<HostToken>(); JSONParser parser = new JSONParser(); try { JSONArray arr = (JSONArray) parser.parse(json); Iterator<?> iter = arr.iterator(); while (iter.hasNext...
java
List<HostToken> parseTokenListFromJson(String json) { List<HostToken> hostTokens = new ArrayList<HostToken>(); JSONParser parser = new JSONParser(); try { JSONArray arr = (JSONArray) parser.parse(json); Iterator<?> iter = arr.iterator(); while (iter.hasNext...
[ "List", "<", "HostToken", ">", "parseTokenListFromJson", "(", "String", "json", ")", "{", "List", "<", "HostToken", ">", "hostTokens", "=", "new", "ArrayList", "<", "HostToken", ">", "(", ")", ";", "JSONParser", "parser", "=", "new", "JSONParser", "(", ")"...
package-private for Test
[ "package", "-", "private", "for", "Test" ]
158f807083ea8e9b09c8089cb07f98e954ad5b23
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/lb/AbstractTokenMapSupplier.java#L210-L258
55,558
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/request/ProfileRequest.java
ProfileRequest.start
@Override public void start(final BaseCallback<Authentication, AuthenticationException> callback) { credentialsRequest.start(new BaseCallback<Credentials, AuthenticationException>() { @Override public void onSuccess(final Credentials credentials) { userInfoRequest ...
java
@Override public void start(final BaseCallback<Authentication, AuthenticationException> callback) { credentialsRequest.start(new BaseCallback<Credentials, AuthenticationException>() { @Override public void onSuccess(final Credentials credentials) { userInfoRequest ...
[ "@", "Override", "public", "void", "start", "(", "final", "BaseCallback", "<", "Authentication", ",", "AuthenticationException", ">", "callback", ")", "{", "credentialsRequest", ".", "start", "(", "new", "BaseCallback", "<", "Credentials", ",", "AuthenticationExcept...
Starts the log in request and then fetches the user's profile @param callback called on either success or failure
[ "Starts", "the", "log", "in", "request", "and", "then", "fetches", "the", "user", "s", "profile" ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/ProfileRequest.java#L92-L117
55,559
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/request/ProfileRequest.java
ProfileRequest.execute
@Override public Authentication execute() throws Auth0Exception { Credentials credentials = credentialsRequest.execute(); UserProfile profile = userInfoRequest .addHeader(HEADER_AUTHORIZATION, "Bearer " + credentials.getAccessToken()) .execute(); return new Au...
java
@Override public Authentication execute() throws Auth0Exception { Credentials credentials = credentialsRequest.execute(); UserProfile profile = userInfoRequest .addHeader(HEADER_AUTHORIZATION, "Bearer " + credentials.getAccessToken()) .execute(); return new Au...
[ "@", "Override", "public", "Authentication", "execute", "(", ")", "throws", "Auth0Exception", "{", "Credentials", "credentials", "=", "credentialsRequest", ".", "execute", "(", ")", ";", "UserProfile", "profile", "=", "userInfoRequest", ".", "addHeader", "(", "HEA...
Logs in the user with Auth0 and fetches it's profile. @return authentication object containing the user's tokens and profile @throws Auth0Exception when either authentication or profile fetch fails
[ "Logs", "in", "the", "user", "with", "Auth0", "and", "fetches", "it", "s", "profile", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/ProfileRequest.java#L125-L132
55,560
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/result/UserProfile.java
UserProfile.getExtraInfo
public Map<String, Object> getExtraInfo() { return extraInfo != null ? new HashMap<>(extraInfo) : Collections.<String, Object>emptyMap(); }
java
public Map<String, Object> getExtraInfo() { return extraInfo != null ? new HashMap<>(extraInfo) : Collections.<String, Object>emptyMap(); }
[ "public", "Map", "<", "String", ",", "Object", ">", "getExtraInfo", "(", ")", "{", "return", "extraInfo", "!=", "null", "?", "new", "HashMap", "<>", "(", "extraInfo", ")", ":", "Collections", ".", "<", "String", ",", "Object", ">", "emptyMap", "(", ")"...
Returns extra information of the profile that is not part of the normalized profile @return a map with user's extra information found in the profile
[ "Returns", "extra", "information", "of", "the", "profile", "that", "is", "not", "part", "of", "the", "normalized", "profile" ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/result/UserProfile.java#L129-L131
55,561
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/request/SignUpRequest.java
SignUpRequest.addAuthenticationParameters
@Override public SignUpRequest addAuthenticationParameters(Map<String, Object> parameters) { authenticationRequest.addAuthenticationParameters(parameters); return this; }
java
@Override public SignUpRequest addAuthenticationParameters(Map<String, Object> parameters) { authenticationRequest.addAuthenticationParameters(parameters); return this; }
[ "@", "Override", "public", "SignUpRequest", "addAuthenticationParameters", "(", "Map", "<", "String", ",", "Object", ">", "parameters", ")", "{", "authenticationRequest", ".", "addAuthenticationParameters", "(", "parameters", ")", ";", "return", "this", ";", "}" ]
Add additional parameters sent when logging the user in @param parameters sent with the request and must be non-null @return itself @see ParameterBuilder
[ "Add", "additional", "parameters", "sent", "when", "logging", "the", "user", "in" ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/SignUpRequest.java#L88-L92
55,562
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/request/SignUpRequest.java
SignUpRequest.start
@Override public void start(final BaseCallback<Credentials, AuthenticationException> callback) { signUpRequest.start(new BaseCallback<DatabaseUser, AuthenticationException>() { @Override public void onSuccess(final DatabaseUser user) { authenticationRequest.start(call...
java
@Override public void start(final BaseCallback<Credentials, AuthenticationException> callback) { signUpRequest.start(new BaseCallback<DatabaseUser, AuthenticationException>() { @Override public void onSuccess(final DatabaseUser user) { authenticationRequest.start(call...
[ "@", "Override", "public", "void", "start", "(", "final", "BaseCallback", "<", "Credentials", ",", "AuthenticationException", ">", "callback", ")", "{", "signUpRequest", ".", "start", "(", "new", "BaseCallback", "<", "DatabaseUser", ",", "AuthenticationException", ...
Starts to execute create user request and then logs the user in. @param callback called on either success or failure.
[ "Starts", "to", "execute", "create", "user", "request", "and", "then", "logs", "the", "user", "in", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/SignUpRequest.java#L143-L156
55,563
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/provider/CustomTabsController.java
CustomTabsController.bindService
public void bindService() { Log.v(TAG, "Trying to bind the service"); Context context = this.context.get(); isBound = false; if (context != null && preferredPackage != null) { isBound = CustomTabsClient.bindCustomTabsService(context, preferredPackage, this); } ...
java
public void bindService() { Log.v(TAG, "Trying to bind the service"); Context context = this.context.get(); isBound = false; if (context != null && preferredPackage != null) { isBound = CustomTabsClient.bindCustomTabsService(context, preferredPackage, this); } ...
[ "public", "void", "bindService", "(", ")", "{", "Log", ".", "v", "(", "TAG", ",", "\"Trying to bind the service\"", ")", ";", "Context", "context", "=", "this", ".", "context", ".", "get", "(", ")", ";", "isBound", "=", "false", ";", "if", "(", "contex...
Attempts to bind the Custom Tabs Service to the Context.
[ "Attempts", "to", "bind", "the", "Custom", "Tabs", "Service", "to", "the", "Context", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/CustomTabsController.java#L93-L101
55,564
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/provider/CustomTabsController.java
CustomTabsController.unbindService
public void unbindService() { Log.v(TAG, "Trying to unbind the service"); Context context = this.context.get(); if (isBound && context != null) { context.unbindService(this); isBound = false; } }
java
public void unbindService() { Log.v(TAG, "Trying to unbind the service"); Context context = this.context.get(); if (isBound && context != null) { context.unbindService(this); isBound = false; } }
[ "public", "void", "unbindService", "(", ")", "{", "Log", ".", "v", "(", "TAG", ",", "\"Trying to unbind the service\"", ")", ";", "Context", "context", "=", "this", ".", "context", ".", "get", "(", ")", ";", "if", "(", "isBound", "&&", "context", "!=", ...
Attempts to unbind the Custom Tabs Service from the Context.
[ "Attempts", "to", "unbind", "the", "Custom", "Tabs", "Service", "from", "the", "Context", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/CustomTabsController.java#L106-L113
55,565
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/provider/PKCE.java
PKCE.getToken
public void getToken(String authorizationCode, @NonNull final AuthCallback callback) { apiClient.token(authorizationCode, redirectUri) .setCodeVerifier(codeVerifier) .start(new BaseCallback<Credentials, AuthenticationException>() { @Override ...
java
public void getToken(String authorizationCode, @NonNull final AuthCallback callback) { apiClient.token(authorizationCode, redirectUri) .setCodeVerifier(codeVerifier) .start(new BaseCallback<Credentials, AuthenticationException>() { @Override ...
[ "public", "void", "getToken", "(", "String", "authorizationCode", ",", "@", "NonNull", "final", "AuthCallback", "callback", ")", "{", "apiClient", ".", "token", "(", "authorizationCode", ",", "redirectUri", ")", ".", "setCodeVerifier", "(", "codeVerifier", ")", ...
Performs a request to the Auth0 API to get the OAuth Token and end the PKCE flow. The instance of this class must be disposed after this method is called. @param authorizationCode received in the call to /authorize with a "grant_type=code" @param callback to notify the result of this call to.
[ "Performs", "a", "request", "to", "the", "Auth0", "API", "to", "get", "the", "OAuth", "Token", "and", "end", "the", "PKCE", "flow", ".", "The", "instance", "of", "this", "class", "must", "be", "disposed", "after", "this", "method", "is", "called", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/PKCE.java#L84-L101
55,566
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/provider/AuthProvider.java
AuthProvider.checkPermissions
private boolean checkPermissions(Activity activity) { String[] permissions = getRequiredAndroidPermissions(); return handler.areAllPermissionsGranted(activity, permissions); }
java
private boolean checkPermissions(Activity activity) { String[] permissions = getRequiredAndroidPermissions(); return handler.areAllPermissionsGranted(activity, permissions); }
[ "private", "boolean", "checkPermissions", "(", "Activity", "activity", ")", "{", "String", "[", "]", "permissions", "=", "getRequiredAndroidPermissions", "(", ")", ";", "return", "handler", ".", "areAllPermissionsGranted", "(", "activity", ",", "permissions", ")", ...
Checks if all the required Android Manifest.permissions have already been granted. @param activity a valid activity context. @return true if all the requested permissions are already granted, false otherwise.
[ "Checks", "if", "all", "the", "required", "Android", "Manifest", ".", "permissions", "have", "already", "been", "granted", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/AuthProvider.java#L185-L188
55,567
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/provider/AuthProvider.java
AuthProvider.requestPermissions
private void requestPermissions(Activity activity, int requestCode) { String[] permissions = getRequiredAndroidPermissions(); handler.requestPermissions(activity, permissions, requestCode); }
java
private void requestPermissions(Activity activity, int requestCode) { String[] permissions = getRequiredAndroidPermissions(); handler.requestPermissions(activity, permissions, requestCode); }
[ "private", "void", "requestPermissions", "(", "Activity", "activity", ",", "int", "requestCode", ")", "{", "String", "[", "]", "permissions", "=", "getRequiredAndroidPermissions", "(", ")", ";", "handler", ".", "requestPermissions", "(", "activity", ",", "permissi...
Starts the async Permission Request. The caller activity will be notified of the result on the onRequestPermissionsResult method, from the ActivityCompat.OnRequestPermissionsResultCallback interface. @param activity a valid activity context. It will receive the permissions request result on the onRequestPermissions...
[ "Starts", "the", "async", "Permission", "Request", ".", "The", "caller", "activity", "will", "be", "notified", "of", "the", "result", "on", "the", "onRequestPermissionsResult", "method", "from", "the", "ActivityCompat", ".", "OnRequestPermissionsResultCallback", "inte...
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/AuthProvider.java#L199-L202
55,568
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/request/DelegationRequest.java
DelegationRequest.addParameters
public DelegationRequest<T> addParameters(Map<String, Object> parameters) { request.addParameters(parameters); return this; }
java
public DelegationRequest<T> addParameters(Map<String, Object> parameters) { request.addParameters(parameters); return this; }
[ "public", "DelegationRequest", "<", "T", ">", "addParameters", "(", "Map", "<", "String", ",", "Object", ">", "parameters", ")", "{", "request", ".", "addParameters", "(", "parameters", ")", ";", "return", "this", ";", "}" ]
Add additional parameters to be sent in the request @param parameters as a non-null dictionary @return itself
[ "Add", "additional", "parameters", "to", "be", "sent", "in", "the", "request" ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/DelegationRequest.java#L64-L67
55,569
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/request/DelegationRequest.java
DelegationRequest.setScope
public DelegationRequest<T> setScope(String scope) { request.addParameter(ParameterBuilder.SCOPE_KEY, scope); return this; }
java
public DelegationRequest<T> setScope(String scope) { request.addParameter(ParameterBuilder.SCOPE_KEY, scope); return this; }
[ "public", "DelegationRequest", "<", "T", ">", "setScope", "(", "String", "scope", ")", "{", "request", ".", "addParameter", "(", "ParameterBuilder", ".", "SCOPE_KEY", ",", "scope", ")", ";", "return", "this", ";", "}" ]
Set the 'scope' used to make the delegation @param scope value @return itself
[ "Set", "the", "scope", "used", "to", "make", "the", "delegation" ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/DelegationRequest.java#L86-L89
55,570
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java
AuthenticationAPIClient.passwordless
@SuppressWarnings("WeakerAccess") private ParameterizableRequest<Void, AuthenticationException> passwordless() { HttpUrl url = HttpUrl.parse(auth0.getDomainUrl()).newBuilder() .addPathSegment(PASSWORDLESS_PATH) .addPathSegment(START_PATH) .build(); fi...
java
@SuppressWarnings("WeakerAccess") private ParameterizableRequest<Void, AuthenticationException> passwordless() { HttpUrl url = HttpUrl.parse(auth0.getDomainUrl()).newBuilder() .addPathSegment(PASSWORDLESS_PATH) .addPathSegment(START_PATH) .build(); fi...
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "private", "ParameterizableRequest", "<", "Void", ",", "AuthenticationException", ">", "passwordless", "(", ")", "{", "HttpUrl", "url", "=", "HttpUrl", ".", "parse", "(", "auth0", ".", "getDomainUrl", "(", "...
Start a custom passwordless flow @return a request to configure and start
[ "Start", "a", "custom", "passwordless", "flow" ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L1005-L1018
55,571
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/request/internal/BaseAuthenticationRequest.java
BaseAuthenticationRequest.setConnection
@Override public AuthenticationRequest setConnection(String connection) { if (!hasLegacyPath()) { Log.w(TAG, "Not setting the 'connection' parameter as the request is using a OAuth 2.0 API Authorization endpoint that doesn't support it."); return this; } addParameter(...
java
@Override public AuthenticationRequest setConnection(String connection) { if (!hasLegacyPath()) { Log.w(TAG, "Not setting the 'connection' parameter as the request is using a OAuth 2.0 API Authorization endpoint that doesn't support it."); return this; } addParameter(...
[ "@", "Override", "public", "AuthenticationRequest", "setConnection", "(", "String", "connection", ")", "{", "if", "(", "!", "hasLegacyPath", "(", ")", ")", "{", "Log", ".", "w", "(", "TAG", ",", "\"Not setting the 'connection' parameter as the request is using a OAuth...
Sets the 'connection' parameter. @param connection name of the connection @return itself
[ "Sets", "the", "connection", "parameter", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/request/internal/BaseAuthenticationRequest.java#L53-L61
55,572
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/request/internal/BaseAuthenticationRequest.java
BaseAuthenticationRequest.setRealm
@Override public AuthenticationRequest setRealm(String realm) { if (hasLegacyPath()) { Log.w(TAG, "Not setting the 'realm' parameter as the request is using a Legacy Authorization API endpoint that doesn't support it."); return this; } addParameter(REALM_KEY, realm); ...
java
@Override public AuthenticationRequest setRealm(String realm) { if (hasLegacyPath()) { Log.w(TAG, "Not setting the 'realm' parameter as the request is using a Legacy Authorization API endpoint that doesn't support it."); return this; } addParameter(REALM_KEY, realm); ...
[ "@", "Override", "public", "AuthenticationRequest", "setRealm", "(", "String", "realm", ")", "{", "if", "(", "hasLegacyPath", "(", ")", ")", "{", "Log", ".", "w", "(", "TAG", ",", "\"Not setting the 'realm' parameter as the request is using a Legacy Authorization API en...
Sets the 'realm' parameter. A realm identifies the host against which the authentication will be made, and usually helps to know which username and password to use. @param realm name of the realm @return itself
[ "Sets", "the", "realm", "parameter", ".", "A", "realm", "identifies", "the", "host", "against", "which", "the", "authentication", "will", "be", "made", "and", "usually", "helps", "to", "know", "which", "username", "and", "password", "to", "use", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/request/internal/BaseAuthenticationRequest.java#L69-L77
55,573
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java
DatabaseConnectionRequest.addParameters
public DatabaseConnectionRequest<T, U> addParameters(Map<String, Object> parameters) { request.addParameters(parameters); return this; }
java
public DatabaseConnectionRequest<T, U> addParameters(Map<String, Object> parameters) { request.addParameters(parameters); return this; }
[ "public", "DatabaseConnectionRequest", "<", "T", ",", "U", ">", "addParameters", "(", "Map", "<", "String", ",", "Object", ">", "parameters", ")", "{", "request", ".", "addParameters", "(", "parameters", ")", ";", "return", "this", ";", "}" ]
Add the given parameters to the request @param parameters to be sent with the request @return itself
[ "Add", "the", "given", "parameters", "to", "the", "request" ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java#L27-L30
55,574
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java
DatabaseConnectionRequest.addParameter
public DatabaseConnectionRequest<T, U> addParameter(String name, Object value) { request.addParameter(name, value); return this; }
java
public DatabaseConnectionRequest<T, U> addParameter(String name, Object value) { request.addParameter(name, value); return this; }
[ "public", "DatabaseConnectionRequest", "<", "T", ",", "U", ">", "addParameter", "(", "String", "name", ",", "Object", "value", ")", "{", "request", ".", "addParameter", "(", "name", ",", "value", ")", ";", "return", "this", ";", "}" ]
Add a parameter by name to the request @param name of the parameter @param value of the parameter @return itself
[ "Add", "a", "parameter", "by", "name", "to", "the", "request" ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java#L38-L41
55,575
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java
DatabaseConnectionRequest.setConnection
public DatabaseConnectionRequest<T, U> setConnection(String connection) { request.addParameter(ParameterBuilder.CONNECTION_KEY, connection); return this; }
java
public DatabaseConnectionRequest<T, U> setConnection(String connection) { request.addParameter(ParameterBuilder.CONNECTION_KEY, connection); return this; }
[ "public", "DatabaseConnectionRequest", "<", "T", ",", "U", ">", "setConnection", "(", "String", "connection", ")", "{", "request", ".", "addParameter", "(", "ParameterBuilder", ".", "CONNECTION_KEY", ",", "connection", ")", ";", "return", "this", ";", "}" ]
Set the Auth0 Database Connection used for this request using its name. @param connection name @return itself
[ "Set", "the", "Auth0", "Database", "Connection", "used", "for", "this", "request", "using", "its", "name", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/request/DatabaseConnectionRequest.java#L59-L62
55,576
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/request/internal/OkHttpClientFactory.java
OkHttpClientFactory.createClient
public OkHttpClient createClient(boolean loggingEnabled, boolean tls12Enforced, int connectTimeout, int readTimeout, int writeTimeout) { return modifyClient(new OkHttpClient(), loggingEnabled, tls12Enforced, connectTimeout, readTimeout, writeTimeout); }
java
public OkHttpClient createClient(boolean loggingEnabled, boolean tls12Enforced, int connectTimeout, int readTimeout, int writeTimeout) { return modifyClient(new OkHttpClient(), loggingEnabled, tls12Enforced, connectTimeout, readTimeout, writeTimeout); }
[ "public", "OkHttpClient", "createClient", "(", "boolean", "loggingEnabled", ",", "boolean", "tls12Enforced", ",", "int", "connectTimeout", ",", "int", "readTimeout", ",", "int", "writeTimeout", ")", "{", "return", "modifyClient", "(", "new", "OkHttpClient", "(", "...
This method creates an instance of OKHttpClient according to the provided parameters. It is used internally and is not intended to be used directly. @param loggingEnabled Enable logging in the created OkHttpClient. @param tls12Enforced Enforce TLS 1.2 in the created OkHttpClient on devices with API 16-21 @param conne...
[ "This", "method", "creates", "an", "instance", "of", "OKHttpClient", "according", "to", "the", "provided", "parameters", ".", "It", "is", "used", "internally", "and", "is", "not", "intended", "to", "be", "used", "directly", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/request/internal/OkHttpClientFactory.java#L43-L45
55,577
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/request/internal/OkHttpClientFactory.java
OkHttpClientFactory.enforceTls12
private void enforceTls12(OkHttpClient client) { // No need to modify client as TLS 1.2 is enabled by default on API21+ // Lollipop is included because some Samsung devices face the same problem on API 21. if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN || Build.VERSIO...
java
private void enforceTls12(OkHttpClient client) { // No need to modify client as TLS 1.2 is enabled by default on API21+ // Lollipop is included because some Samsung devices face the same problem on API 21. if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN || Build.VERSIO...
[ "private", "void", "enforceTls12", "(", "OkHttpClient", "client", ")", "{", "// No need to modify client as TLS 1.2 is enabled by default on API21+", "// Lollipop is included because some Samsung devices face the same problem on API 21.", "if", "(", "Build", ".", "VERSION", ".", "SDK...
Enable TLS 1.2 on the OkHttpClient on API 16-21, which is supported but not enabled by default. @link https://github.com/square/okhttp/issues/2372 @see TLS12SocketFactory
[ "Enable", "TLS", "1", ".", "2", "on", "the", "OkHttpClient", "on", "API", "16", "-", "21", "which", "is", "supported", "but", "not", "enabled", "by", "default", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/request/internal/OkHttpClientFactory.java#L80-L105
55,578
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/ParameterBuilder.java
ParameterBuilder.addAll
public ParameterBuilder addAll(Map<String, Object> parameters) { if (parameters != null) { for (String k : parameters.keySet()) { if (parameters.get(k) != null) { this.parameters.put(k, parameters.get(k)); } } } return t...
java
public ParameterBuilder addAll(Map<String, Object> parameters) { if (parameters != null) { for (String k : parameters.keySet()) { if (parameters.get(k) != null) { this.parameters.put(k, parameters.get(k)); } } } return t...
[ "public", "ParameterBuilder", "addAll", "(", "Map", "<", "String", ",", "Object", ">", "parameters", ")", "{", "if", "(", "parameters", "!=", "null", ")", "{", "for", "(", "String", "k", ":", "parameters", ".", "keySet", "(", ")", ")", "{", "if", "("...
Adds all parameter from a map @param parameters map with parameters to add. Null values will be skipped. @return itself
[ "Adds", "all", "parameter", "from", "a", "map" ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/ParameterBuilder.java#L202-L211
55,579
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/provider/AuthorizeResult.java
AuthorizeResult.isValid
public boolean isValid(int expectedRequestCode) { Uri uri = intent != null ? intent.getData() : null; if (uri == null) { Log.d(TAG, "Result is invalid: Received Intent's Uri is null."); return false; } if (requestCode == MISSING_REQUEST_CODE) { return...
java
public boolean isValid(int expectedRequestCode) { Uri uri = intent != null ? intent.getData() : null; if (uri == null) { Log.d(TAG, "Result is invalid: Received Intent's Uri is null."); return false; } if (requestCode == MISSING_REQUEST_CODE) { return...
[ "public", "boolean", "isValid", "(", "int", "expectedRequestCode", ")", "{", "Uri", "uri", "=", "intent", "!=", "null", "?", "intent", ".", "getData", "(", ")", ":", "null", ";", "if", "(", "uri", "==", "null", ")", "{", "Log", ".", "d", "(", "TAG"...
Checks if the received data is valid and can be parsed. @param expectedRequestCode the request code this activity is expecting to receive @return whether if the received uri data can be parsed or not.
[ "Checks", "if", "the", "received", "data", "is", "valid", "and", "can", "be", "parsed", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/AuthorizeResult.java#L71-L87
55,580
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.java
CredentialsManager.hasValidCredentials
public boolean hasValidCredentials() { String accessToken = storage.retrieveString(KEY_ACCESS_TOKEN); String refreshToken = storage.retrieveString(KEY_REFRESH_TOKEN); String idToken = storage.retrieveString(KEY_ID_TOKEN); Long expiresAt = storage.retrieveLong(KEY_EXPIRES_AT); re...
java
public boolean hasValidCredentials() { String accessToken = storage.retrieveString(KEY_ACCESS_TOKEN); String refreshToken = storage.retrieveString(KEY_REFRESH_TOKEN); String idToken = storage.retrieveString(KEY_ID_TOKEN); Long expiresAt = storage.retrieveLong(KEY_EXPIRES_AT); re...
[ "public", "boolean", "hasValidCredentials", "(", ")", "{", "String", "accessToken", "=", "storage", ".", "retrieveString", "(", "KEY_ACCESS_TOKEN", ")", ";", "String", "refreshToken", "=", "storage", ".", "retrieveString", "(", "KEY_REFRESH_TOKEN", ")", ";", "Stri...
Checks if a non-expired pair of credentials can be obtained from this manager. @return whether there are valid credentials stored on this manager.
[ "Checks", "if", "a", "non", "-", "expired", "pair", "of", "credentials", "can", "be", "obtained", "from", "this", "manager", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.java#L108-L117
55,581
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.java
CredentialsManager.clearCredentials
public void clearCredentials() { storage.remove(KEY_ACCESS_TOKEN); storage.remove(KEY_REFRESH_TOKEN); storage.remove(KEY_ID_TOKEN); storage.remove(KEY_TOKEN_TYPE); storage.remove(KEY_EXPIRES_AT); storage.remove(KEY_SCOPE); }
java
public void clearCredentials() { storage.remove(KEY_ACCESS_TOKEN); storage.remove(KEY_REFRESH_TOKEN); storage.remove(KEY_ID_TOKEN); storage.remove(KEY_TOKEN_TYPE); storage.remove(KEY_EXPIRES_AT); storage.remove(KEY_SCOPE); }
[ "public", "void", "clearCredentials", "(", ")", "{", "storage", ".", "remove", "(", "KEY_ACCESS_TOKEN", ")", ";", "storage", ".", "remove", "(", "KEY_REFRESH_TOKEN", ")", ";", "storage", ".", "remove", "(", "KEY_ID_TOKEN", ")", ";", "storage", ".", "remove",...
Removes the credentials from the storage if present.
[ "Removes", "the", "credentials", "from", "the", "storage", "if", "present", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.java#L122-L129
55,582
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java
SecureCredentialsManager.clearCredentials
public void clearCredentials() { storage.remove(KEY_CREDENTIALS); storage.remove(KEY_EXPIRES_AT); storage.remove(KEY_CAN_REFRESH); Log.d(TAG, "Credentials were just removed from the storage"); }
java
public void clearCredentials() { storage.remove(KEY_CREDENTIALS); storage.remove(KEY_EXPIRES_AT); storage.remove(KEY_CAN_REFRESH); Log.d(TAG, "Credentials were just removed from the storage"); }
[ "public", "void", "clearCredentials", "(", ")", "{", "storage", ".", "remove", "(", "KEY_CREDENTIALS", ")", ";", "storage", ".", "remove", "(", "KEY_EXPIRES_AT", ")", ";", "storage", ".", "remove", "(", "KEY_CAN_REFRESH", ")", ";", "Log", ".", "d", "(", ...
Delete the stored credentials
[ "Delete", "the", "stored", "credentials" ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java#L195-L200
55,583
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java
SecureCredentialsManager.hasValidCredentials
public boolean hasValidCredentials() { String encryptedEncoded = storage.retrieveString(KEY_CREDENTIALS); Long expiresAt = storage.retrieveLong(KEY_EXPIRES_AT); Boolean canRefresh = storage.retrieveBoolean(KEY_CAN_REFRESH); return !(isEmpty(encryptedEncoded) || expiresAt ...
java
public boolean hasValidCredentials() { String encryptedEncoded = storage.retrieveString(KEY_CREDENTIALS); Long expiresAt = storage.retrieveLong(KEY_EXPIRES_AT); Boolean canRefresh = storage.retrieveBoolean(KEY_CAN_REFRESH); return !(isEmpty(encryptedEncoded) || expiresAt ...
[ "public", "boolean", "hasValidCredentials", "(", ")", "{", "String", "encryptedEncoded", "=", "storage", ".", "retrieveString", "(", "KEY_CREDENTIALS", ")", ";", "Long", "expiresAt", "=", "storage", ".", "retrieveLong", "(", "KEY_EXPIRES_AT", ")", ";", "Boolean", ...
Returns whether this manager contains a valid non-expired pair of credentials. @return whether this manager contains a valid non-expired pair of credentials or not.
[ "Returns", "whether", "this", "manager", "contains", "a", "valid", "non", "-", "expired", "pair", "of", "credentials", "." ]
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.java#L207-L214
55,584
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/EntryIterator.java
EntryIterator.hasNext
@Override public boolean hasNext() { if (!members.hasNext()) { try { getNextEntries(); } catch (final Exception ignored) { LOG.error("An error occured while getting next entries", ignored); } } return members.hasNext(); ...
java
@Override public boolean hasNext() { if (!members.hasNext()) { try { getNextEntries(); } catch (final Exception ignored) { LOG.error("An error occured while getting next entries", ignored); } } return members.hasNext(); ...
[ "@", "Override", "public", "boolean", "hasNext", "(", ")", "{", "if", "(", "!", "members", ".", "hasNext", "(", ")", ")", "{", "try", "{", "getNextEntries", "(", ")", ";", "}", "catch", "(", "final", "Exception", "ignored", ")", "{", "LOG", ".", "e...
Returns true if more entries are available.
[ "Returns", "true", "if", "more", "entries", "are", "available", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/EntryIterator.java#L61-L71
55,585
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/EntryIterator.java
EntryIterator.next
@Override public ClientEntry next() { if (hasNext()) { final Entry romeEntry = members.next(); try { if (!romeEntry.isMediaEntry()) { return new ClientEntry(null, collection, romeEntry, true); } else { return new...
java
@Override public ClientEntry next() { if (hasNext()) { final Entry romeEntry = members.next(); try { if (!romeEntry.isMediaEntry()) { return new ClientEntry(null, collection, romeEntry, true); } else { return new...
[ "@", "Override", "public", "ClientEntry", "next", "(", ")", "{", "if", "(", "hasNext", "(", ")", ")", "{", "final", "Entry", "romeEntry", "=", "members", ".", "next", "(", ")", ";", "try", "{", "if", "(", "!", "romeEntry", ".", "isMediaEntry", "(", ...
Get next entry in collection.
[ "Get", "next", "entry", "in", "collection", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/EntryIterator.java#L76-L91
55,586
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java
ClientCollection.getEntry
public ClientEntry getEntry(final String uri) throws ProponoException { final GetMethod method = new GetMethod(uri); authStrategy.addAuthentication(httpClient, method); try { httpClient.executeMethod(method); if (method.getStatusCode() != 200) { throw new ...
java
public ClientEntry getEntry(final String uri) throws ProponoException { final GetMethod method = new GetMethod(uri); authStrategy.addAuthentication(httpClient, method); try { httpClient.executeMethod(method); if (method.getStatusCode() != 200) { throw new ...
[ "public", "ClientEntry", "getEntry", "(", "final", "String", "uri", ")", "throws", "ProponoException", "{", "final", "GetMethod", "method", "=", "new", "GetMethod", "(", "uri", ")", ";", "authStrategy", ".", "addAuthentication", "(", "httpClient", ",", "method",...
Get full entry specified by entry edit URI. Note that entry may or may not be associated with this collection. @return ClientEntry or ClientMediaEntry specified by URI.
[ "Get", "full", "entry", "specified", "by", "entry", "edit", "URI", ".", "Note", "that", "entry", "may", "or", "may", "not", "be", "associated", "with", "this", "collection", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java#L100-L119
55,587
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java
ClientCollection.createMediaEntry
public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final byte[] bytes) throws ProponoException { if (!isWritable()) { throw new ProponoException("Collection is not writable"); } return new ClientMediaEntry(service, this, title, s...
java
public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final byte[] bytes) throws ProponoException { if (!isWritable()) { throw new ProponoException("Collection is not writable"); } return new ClientMediaEntry(service, this, title, s...
[ "public", "ClientMediaEntry", "createMediaEntry", "(", "final", "String", "title", ",", "final", "String", "slug", ",", "final", "String", "contentType", ",", "final", "byte", "[", "]", "bytes", ")", "throws", "ProponoException", "{", "if", "(", "!", "isWritab...
Create new media entry assocaited with collection, but do not save. server. Depending on the Atom server, you may or may not be able to persist the properties of the entry that is returned. @param title Title to used for uploaded file. @param slug String to be used in file-name of stored file @param contentType MIME c...
[ "Create", "new", "media", "entry", "assocaited", "with", "collection", "but", "do", "not", "save", ".", "server", ".", "Depending", "on", "the", "Atom", "server", "you", "may", "or", "may", "not", "be", "able", "to", "persist", "the", "properties", "of", ...
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java#L158-L163
55,588
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java
ClientCollection.createMediaEntry
public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final InputStream is) throws ProponoException { if (!isWritable()) { throw new ProponoException("Collection is not writable"); } return new ClientMediaEntry(service, this, title,...
java
public ClientMediaEntry createMediaEntry(final String title, final String slug, final String contentType, final InputStream is) throws ProponoException { if (!isWritable()) { throw new ProponoException("Collection is not writable"); } return new ClientMediaEntry(service, this, title,...
[ "public", "ClientMediaEntry", "createMediaEntry", "(", "final", "String", "title", ",", "final", "String", "slug", ",", "final", "String", "contentType", ",", "final", "InputStream", "is", ")", "throws", "ProponoException", "{", "if", "(", "!", "isWritable", "("...
Create new media entry assocaited with collection, but do not save. server. Depending on the Atom server, you may or may not be able to. persist the properties of the entry that is returned. @param title Title to used for uploaded file. @param slug String to be used in file-name of stored file @param contentType MIME ...
[ "Create", "new", "media", "entry", "assocaited", "with", "collection", "but", "do", "not", "save", ".", "server", ".", "Depending", "on", "the", "Atom", "server", "you", "may", "or", "may", "not", "be", "able", "to", ".", "persist", "the", "properties", ...
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientCollection.java#L176-L181
55,589
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/common/rome/AppModuleParser.java
AppModuleParser.parse
@Override public Module parse(final Element elem, final Locale locale) { final AppModule m = new AppModuleImpl(); final Element control = elem.getChild("control", getContentNamespace()); if (control != null) { final Element draftElem = control.getChild("draft", getContentNamespac...
java
@Override public Module parse(final Element elem, final Locale locale) { final AppModule m = new AppModuleImpl(); final Element control = elem.getChild("control", getContentNamespace()); if (control != null) { final Element draftElem = control.getChild("draft", getContentNamespac...
[ "@", "Override", "public", "Module", "parse", "(", "final", "Element", "elem", ",", "final", "Locale", "locale", ")", "{", "final", "AppModule", "m", "=", "new", "AppModuleImpl", "(", ")", ";", "final", "Element", "control", "=", "elem", ".", "getChild", ...
Parse JDOM element into module
[ "Parse", "JDOM", "element", "into", "module" ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/common/rome/AppModuleParser.java#L51-L74
55,590
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/ClientMediaEntry.java
ClientMediaEntry.getAsStream
public InputStream getAsStream() throws ProponoException { if (getContents() != null && !getContents().isEmpty()) { final Content c = getContents().get(0); if (c.getSrc() != null) { return getResourceAsStream(); } else if (inputStream != null) { ...
java
public InputStream getAsStream() throws ProponoException { if (getContents() != null && !getContents().isEmpty()) { final Content c = getContents().get(0); if (c.getSrc() != null) { return getResourceAsStream(); } else if (inputStream != null) { ...
[ "public", "InputStream", "getAsStream", "(", ")", "throws", "ProponoException", "{", "if", "(", "getContents", "(", ")", "!=", "null", "&&", "!", "getContents", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "final", "Content", "c", "=", "getContents", "(...
Get media resource as an InputStream, should work regardless of whether you set the media resource data as an InputStream or as a byte array.
[ "Get", "media", "resource", "as", "an", "InputStream", "should", "work", "regardless", "of", "whether", "you", "set", "the", "media", "resource", "data", "as", "an", "InputStream", "or", "as", "a", "byte", "array", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientMediaEntry.java#L162-L177
55,591
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/ClientMediaEntry.java
ClientMediaEntry.update
@Override public void update() throws ProponoException { if (partial) { throw new ProponoException("ERROR: attempt to update partial entry"); } EntityEnclosingMethod method = null; final Content updateContent = getContents().get(0); try { if (getMediaL...
java
@Override public void update() throws ProponoException { if (partial) { throw new ProponoException("ERROR: attempt to update partial entry"); } EntityEnclosingMethod method = null; final Content updateContent = getContents().get(0); try { if (getMediaL...
[ "@", "Override", "public", "void", "update", "(", ")", "throws", "ProponoException", "{", "if", "(", "partial", ")", "{", "throw", "new", "ProponoException", "(", "\"ERROR: attempt to update partial entry\"", ")", ";", "}", "EntityEnclosingMethod", "method", "=", ...
Update entry on server.
[ "Update", "entry", "on", "server", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientMediaEntry.java#L198-L243
55,592
rometools/rome
rome-certiorem/src/main/java/com/rometools/certiorem/hub/DeltaSyndFeedInfo.java
DeltaSyndFeedInfo.setSyndFeed
@Override public final synchronized void setSyndFeed(final SyndFeed feed) { super.setSyndFeed(feed); changedMap.clear(); final List<SyndEntry> entries = feed.getEntries(); for (final SyndEntry entry : entries) { final String currentEntryTag = computeEntryTag(entry); ...
java
@Override public final synchronized void setSyndFeed(final SyndFeed feed) { super.setSyndFeed(feed); changedMap.clear(); final List<SyndEntry> entries = feed.getEntries(); for (final SyndEntry entry : entries) { final String currentEntryTag = computeEntryTag(entry); ...
[ "@", "Override", "public", "final", "synchronized", "void", "setSyndFeed", "(", "final", "SyndFeed", "feed", ")", "{", "super", ".", "setSyndFeed", "(", "feed", ")", ";", "changedMap", ".", "clear", "(", ")", ";", "final", "List", "<", "SyndEntry", ">", ...
Overrides super class method to update changedMap and entryTagsMap for tracking changed entries. @param feed
[ "Overrides", "super", "class", "method", "to", "update", "changedMap", "and", "entryTagsMap", "for", "tracking", "changed", "entries", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-certiorem/src/main/java/com/rometools/certiorem/hub/DeltaSyndFeedInfo.java#L91-L107
55,593
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java
ClientEntry.setContent
public void setContent(final String contentString, final String type) { final Content newContent = new Content(); newContent.setType(type == null ? Content.HTML : type); newContent.setValue(contentString); final ArrayList<Content> contents = new ArrayList<Content>(); contents.add...
java
public void setContent(final String contentString, final String type) { final Content newContent = new Content(); newContent.setType(type == null ? Content.HTML : type); newContent.setValue(contentString); final ArrayList<Content> contents = new ArrayList<Content>(); contents.add...
[ "public", "void", "setContent", "(", "final", "String", "contentString", ",", "final", "String", "type", ")", "{", "final", "Content", "newContent", "=", "new", "Content", "(", ")", ";", "newContent", ".", "setType", "(", "type", "==", "null", "?", "Conten...
Set content of entry. @param contentString content string. @param type Must be "text" for plain text, "html" for escaped HTML, "xhtml" for XHTML or a valid MIME content-type.
[ "Set", "content", "of", "entry", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java#L87-L94
55,594
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java
ClientEntry.setContent
public void setContent(final Content c) { final ArrayList<Content> contents = new ArrayList<Content>(); contents.add(c); setContents(contents); }
java
public void setContent(final Content c) { final ArrayList<Content> contents = new ArrayList<Content>(); contents.add(c); setContents(contents); }
[ "public", "void", "setContent", "(", "final", "Content", "c", ")", "{", "final", "ArrayList", "<", "Content", ">", "contents", "=", "new", "ArrayList", "<", "Content", ">", "(", ")", ";", "contents", ".", "add", "(", "c", ")", ";", "setContents", "(", ...
Convenience method to set first content object in content collection. Atom 1.0 allows only one content element per entry.
[ "Convenience", "method", "to", "set", "first", "content", "object", "in", "content", "collection", ".", "Atom", "1", ".", "0", "allows", "only", "one", "content", "element", "per", "entry", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java#L100-L104
55,595
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java
ClientEntry.getContent
public Content getContent() { if (getContents() != null && !getContents().isEmpty()) { final Content c = getContents().get(0); return c; } return null; }
java
public Content getContent() { if (getContents() != null && !getContents().isEmpty()) { final Content c = getContents().get(0); return c; } return null; }
[ "public", "Content", "getContent", "(", ")", "{", "if", "(", "getContents", "(", ")", "!=", "null", "&&", "!", "getContents", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "final", "Content", "c", "=", "getContents", "(", ")", ".", "get", "(", "0",...
Convenience method to get first content object in content collection. Atom 1.0 allows only one content element per entry.
[ "Convenience", "method", "to", "get", "first", "content", "object", "in", "content", "collection", ".", "Atom", "1", ".", "0", "allows", "only", "one", "content", "element", "per", "entry", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java#L110-L116
55,596
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java
ClientEntry.remove
public void remove() throws ProponoException { if (getEditURI() == null) { throw new ProponoException("ERROR: cannot delete unsaved entry"); } final DeleteMethod method = new DeleteMethod(getEditURI()); addAuthentication(method); try { getHttpClient().exec...
java
public void remove() throws ProponoException { if (getEditURI() == null) { throw new ProponoException("ERROR: cannot delete unsaved entry"); } final DeleteMethod method = new DeleteMethod(getEditURI()); addAuthentication(method); try { getHttpClient().exec...
[ "public", "void", "remove", "(", ")", "throws", "ProponoException", "{", "if", "(", "getEditURI", "(", ")", "==", "null", ")", "{", "throw", "new", "ProponoException", "(", "\"ERROR: cannot delete unsaved entry\"", ")", ";", "}", "final", "DeleteMethod", "method...
Remove entry from server.
[ "Remove", "entry", "from", "server", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java#L171-L184
55,597
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java
ClientEntry.getEditURI
public String getEditURI() { for (int i = 0; i < getOtherLinks().size(); i++) { final Link link = getOtherLinks().get(i); if (link.getRel() != null && link.getRel().equals("edit")) { return link.getHrefResolved(); } } return null; }
java
public String getEditURI() { for (int i = 0; i < getOtherLinks().size(); i++) { final Link link = getOtherLinks().get(i); if (link.getRel() != null && link.getRel().equals("edit")) { return link.getHrefResolved(); } } return null; }
[ "public", "String", "getEditURI", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "getOtherLinks", "(", ")", ".", "size", "(", ")", ";", "i", "++", ")", "{", "final", "Link", "link", "=", "getOtherLinks", "(", ")", ".", "get", "...
Get the URI that can be used to edit the entry via HTTP PUT or DELETE.
[ "Get", "the", "URI", "that", "can", "be", "used", "to", "edit", "the", "entry", "via", "HTTP", "PUT", "or", "DELETE", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java#L197-L205
55,598
rometools/rome
rome-modules/src/main/java/com/rometools/modules/mediarss/types/MediaGroup.java
MediaGroup.setDefaultContentIndex
public void setDefaultContentIndex(final Integer defaultContentIndex) { for (int i = 0; i < getContents().length; i++) { if (i == defaultContentIndex.intValue()) { getContents()[i].setDefaultContent(true); } else { getContents()[i].setDefaultContent(false)...
java
public void setDefaultContentIndex(final Integer defaultContentIndex) { for (int i = 0; i < getContents().length; i++) { if (i == defaultContentIndex.intValue()) { getContents()[i].setDefaultContent(true); } else { getContents()[i].setDefaultContent(false)...
[ "public", "void", "setDefaultContentIndex", "(", "final", "Integer", "defaultContentIndex", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "getContents", "(", ")", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "==", "defaultConte...
Default content index MediaContent. @param defaultContentIndex Default content index MediaContent.
[ "Default", "content", "index", "MediaContent", "." ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/mediarss/types/MediaGroup.java#L97-L107
55,599
rometools/rome
rome-propono/src/main/java/com/rometools/propono/atom/common/Workspace.java
Workspace.workspaceToElement
public Element workspaceToElement() { final Workspace space = this; final Element element = new Element("workspace", AtomService.ATOM_PROTOCOL); final Element titleElem = new Element("title", AtomService.ATOM_FORMAT); titleElem.setText(space.getTitle()); if (space.getTitleType(...
java
public Element workspaceToElement() { final Workspace space = this; final Element element = new Element("workspace", AtomService.ATOM_PROTOCOL); final Element titleElem = new Element("title", AtomService.ATOM_FORMAT); titleElem.setText(space.getTitle()); if (space.getTitleType(...
[ "public", "Element", "workspaceToElement", "(", ")", "{", "final", "Workspace", "space", "=", "this", ";", "final", "Element", "element", "=", "new", "Element", "(", "\"workspace\"", ",", "AtomService", ".", "ATOM_PROTOCOL", ")", ";", "final", "Element", "titl...
Serialize an AtomService.DefaultWorkspace object into an XML element
[ "Serialize", "an", "AtomService", ".", "DefaultWorkspace", "object", "into", "an", "XML", "element" ]
5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/common/Workspace.java#L119-L136