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
partition
stringclasses
1 value
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/codec/RTMP.java
RTMP.freePacket
private void freePacket(Packet packet) { if (packet != null && packet.getData() != null) { packet.clearData(); } }
java
private void freePacket(Packet packet) { if (packet != null && packet.getData() != null) { packet.clearData(); } }
[ "private", "void", "freePacket", "(", "Packet", "packet", ")", "{", "if", "(", "packet", "!=", "null", "&&", "packet", ".", "getData", "(", ")", "!=", "null", ")", "{", "packet", ".", "clearData", "(", ")", ";", "}", "}" ]
Releases a packet. @param packet Packet to release
[ "Releases", "a", "packet", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMP.java#L160-L164
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/codec/RTMP.java
RTMP.freeChannels
private void freeChannels() { for (ChannelInfo info : channels.values()) { freePacket(info.getReadPacket()); freePacket(info.getWritePacket()); } channels.clear(); }
java
private void freeChannels() { for (ChannelInfo info : channels.values()) { freePacket(info.getReadPacket()); freePacket(info.getWritePacket()); } channels.clear(); }
[ "private", "void", "freeChannels", "(", ")", "{", "for", "(", "ChannelInfo", "info", ":", "channels", ".", "values", "(", ")", ")", "{", "freePacket", "(", "info", ".", "getReadPacket", "(", ")", ")", ";", "freePacket", "(", "info", ".", "getWritePacket"...
Releases the channels.
[ "Releases", "the", "channels", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMP.java#L169-L175
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/codec/RTMP.java
RTMP.setLastReadPacket
public void setLastReadPacket(int channelId, Packet packet) { final ChannelInfo info = getChannelInfo(channelId); // grab last packet Packet prevPacket = info.getReadPacket(); // set new one info.setReadPacket(packet); // free the previous packet freePacket...
java
public void setLastReadPacket(int channelId, Packet packet) { final ChannelInfo info = getChannelInfo(channelId); // grab last packet Packet prevPacket = info.getReadPacket(); // set new one info.setReadPacket(packet); // free the previous packet freePacket...
[ "public", "void", "setLastReadPacket", "(", "int", "channelId", ",", "Packet", "packet", ")", "{", "final", "ChannelInfo", "info", "=", "getChannelInfo", "(", "channelId", ")", ";", "// grab last packet\r", "Packet", "prevPacket", "=", "info", ".", "getReadPacket"...
Setter for last read packet. @param channelId Channel id @param packet Packet
[ "Setter", "for", "last", "read", "packet", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMP.java#L244-L252
train
Red5/red5-server-common
src/main/java/org/red5/server/util/FileUtil.java
FileUtil.deleteDirectory
public static boolean deleteDirectory(String directory, boolean useOSNativeDelete) throws IOException { boolean result = false; if (!useOSNativeDelete) { File dir = new File(directory); // first all files have to be cleared out for (File file : dir.listFiles()) {...
java
public static boolean deleteDirectory(String directory, boolean useOSNativeDelete) throws IOException { boolean result = false; if (!useOSNativeDelete) { File dir = new File(directory); // first all files have to be cleared out for (File file : dir.listFiles()) {...
[ "public", "static", "boolean", "deleteDirectory", "(", "String", "directory", ",", "boolean", "useOSNativeDelete", ")", "throws", "IOException", "{", "boolean", "result", "=", "false", ";", "if", "(", "!", "useOSNativeDelete", ")", "{", "File", "dir", "=", "ne...
Deletes a directory and its contents. This will fail if there are any file locks or if the directory cannot be emptied. @param directory directory to delete @param useOSNativeDelete flag to signify use of operating system delete function @throws IOException if directory cannot be deleted @return true if directory was ...
[ "Deletes", "a", "directory", "and", "its", "contents", ".", "This", "will", "fail", "if", "there", "are", "any", "file", "locks", "or", "if", "the", "directory", "cannot", "be", "emptied", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L132-L192
train
Red5/red5-server-common
src/main/java/org/red5/server/util/FileUtil.java
FileUtil.stdOut
private final static Thread stdOut(final Process p) { final byte[] empty = new byte[128]; for (int b = 0; b < empty.length; b++) { empty[b] = (byte) 0; } Thread std = new Thread() { public void run() { StringBuilder sb = new StringBuilder(10...
java
private final static Thread stdOut(final Process p) { final byte[] empty = new byte[128]; for (int b = 0; b < empty.length; b++) { empty[b] = (byte) 0; } Thread std = new Thread() { public void run() { StringBuilder sb = new StringBuilder(10...
[ "private", "final", "static", "Thread", "stdOut", "(", "final", "Process", "p", ")", "{", "final", "byte", "[", "]", "empty", "=", "new", "byte", "[", "128", "]", ";", "for", "(", "int", "b", "=", "0", ";", "b", "<", "empty", ".", "length", ";", ...
Special method for capture of StdOut. @return stdOut thread
[ "Special", "method", "for", "capture", "of", "StdOut", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L215-L242
train
Red5/red5-server-common
src/main/java/org/red5/server/util/FileUtil.java
FileUtil.unzip
public static void unzip(String compressedFileName, String destinationDir) { //strip everything except the applications name String dirName = null; // checks to see if there is a dash "-" in the filename of the war. String applicationName = compressedFileName.substring(compressedFil...
java
public static void unzip(String compressedFileName, String destinationDir) { //strip everything except the applications name String dirName = null; // checks to see if there is a dash "-" in the filename of the war. String applicationName = compressedFileName.substring(compressedFil...
[ "public", "static", "void", "unzip", "(", "String", "compressedFileName", ",", "String", "destinationDir", ")", "{", "//strip everything except the applications name\r", "String", "dirName", "=", "null", ";", "// checks to see if there is a dash \"-\" in the filename of the war. ...
Unzips a war file to an application located under the webapps directory @param compressedFileName The String name of the war file @param destinationDir The destination directory, ie: webapps
[ "Unzips", "a", "war", "file", "to", "an", "application", "located", "under", "the", "webapps", "directory" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L299-L369
train
Red5/red5-server-common
src/main/java/org/red5/server/util/FileUtil.java
FileUtil.formatPath
public static String formatPath(String absWebappsPath, String contextDirName) { StringBuilder path = new StringBuilder(absWebappsPath.length() + contextDirName.length()); path.append(absWebappsPath); if (log.isTraceEnabled()) { log.trace("Path start: {}", path.toString()); ...
java
public static String formatPath(String absWebappsPath, String contextDirName) { StringBuilder path = new StringBuilder(absWebappsPath.length() + contextDirName.length()); path.append(absWebappsPath); if (log.isTraceEnabled()) { log.trace("Path start: {}", path.toString()); ...
[ "public", "static", "String", "formatPath", "(", "String", "absWebappsPath", ",", "String", "contextDirName", ")", "{", "StringBuilder", "path", "=", "new", "StringBuilder", "(", "absWebappsPath", ".", "length", "(", ")", "+", "contextDirName", ".", "length", "(...
Quick-n-dirty directory formatting to support launching in windows, specifically from ant. @param absWebappsPath abs webapps path @param contextDirName conext directory name @return full path
[ "Quick", "-", "n", "-", "dirty", "directory", "formatting", "to", "support", "launching", "in", "windows", "specifically", "from", "ant", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L395-L435
train
Red5/red5-server-common
src/main/java/org/red5/server/util/FileUtil.java
FileUtil.generateCustomName
public static String generateCustomName() { Random random = new Random(); StringBuilder sb = new StringBuilder(); sb.append(PropertyConverter.getCurrentTimeSeconds()); sb.append('_'); int i = random.nextInt(99999); if (i < 10) { sb.append("0000"); ...
java
public static String generateCustomName() { Random random = new Random(); StringBuilder sb = new StringBuilder(); sb.append(PropertyConverter.getCurrentTimeSeconds()); sb.append('_'); int i = random.nextInt(99999); if (i < 10) { sb.append("0000"); ...
[ "public", "static", "String", "generateCustomName", "(", ")", "{", "Random", "random", "=", "new", "Random", "(", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "PropertyConverter", ".", "getCurrentTime...
Generates a custom name containing numbers and an underscore ex. 282818_00023. The name contains current seconds and a random number component. @return custom name
[ "Generates", "a", "custom", "name", "containing", "numbers", "and", "an", "underscore", "ex", ".", "282818_00023", ".", "The", "name", "contains", "current", "seconds", "and", "a", "random", "number", "component", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L442-L459
train
Red5/red5-server-common
src/main/java/org/red5/server/util/FileUtil.java
FileUtil.readAsByteArray
public static byte[] readAsByteArray(File localSwfFile) { byte[] fileBytes = new byte[(int) localSwfFile.length()]; byte[] b = new byte[1]; FileInputStream fis = null; try { fis = new FileInputStream(localSwfFile); for (int i = 0; i < Integer.MAX_VALUE; i++)...
java
public static byte[] readAsByteArray(File localSwfFile) { byte[] fileBytes = new byte[(int) localSwfFile.length()]; byte[] b = new byte[1]; FileInputStream fis = null; try { fis = new FileInputStream(localSwfFile); for (int i = 0; i < Integer.MAX_VALUE; i++)...
[ "public", "static", "byte", "[", "]", "readAsByteArray", "(", "File", "localSwfFile", ")", "{", "byte", "[", "]", "fileBytes", "=", "new", "byte", "[", "(", "int", ")", "localSwfFile", ".", "length", "(", ")", "]", ";", "byte", "[", "]", "b", "=", ...
Reads all the bytes of a given file into an array. If the file size exceeds Integer.MAX_VALUE, it will be truncated. @param localSwfFile swf file @return file bytes
[ "Reads", "all", "the", "bytes", "of", "a", "given", "file", "into", "an", "array", ".", "If", "the", "file", "size", "exceeds", "Integer", ".", "MAX_VALUE", "it", "will", "be", "truncated", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/FileUtil.java#L468-L492
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObjectScope.java
SharedObjectScope.getSecurityHandlers
private Set<ISharedObjectSecurity> getSecurityHandlers() { ISharedObjectSecurityService security = (ISharedObjectSecurityService) ScopeUtils.getScopeService(getParent(), ISharedObjectSecurityService.class); if (security == null) { return null; } return security.getShared...
java
private Set<ISharedObjectSecurity> getSecurityHandlers() { ISharedObjectSecurityService security = (ISharedObjectSecurityService) ScopeUtils.getScopeService(getParent(), ISharedObjectSecurityService.class); if (security == null) { return null; } return security.getShared...
[ "private", "Set", "<", "ISharedObjectSecurity", ">", "getSecurityHandlers", "(", ")", "{", "ISharedObjectSecurityService", "security", "=", "(", "ISharedObjectSecurityService", ")", "ScopeUtils", ".", "getScopeService", "(", "getParent", "(", ")", ",", "ISharedObjectSec...
Return security handlers for this shared object or <pre> null </pre> if none are found. @return set of security handlers
[ "Return", "security", "handlers", "for", "this", "shared", "object", "or" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L487-L493
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObjectScope.java
SharedObjectScope.isConnectionAllowed
protected boolean isConnectionAllowed() { // Check internal handlers first for (ISharedObjectSecurity handler : securityHandlers) { if (!handler.isConnectionAllowed(this)) { return false; } } // Check global SO handlers next final S...
java
protected boolean isConnectionAllowed() { // Check internal handlers first for (ISharedObjectSecurity handler : securityHandlers) { if (!handler.isConnectionAllowed(this)) { return false; } } // Check global SO handlers next final S...
[ "protected", "boolean", "isConnectionAllowed", "(", ")", "{", "// Check internal handlers first\r", "for", "(", "ISharedObjectSecurity", "handler", ":", "securityHandlers", ")", "{", "if", "(", "!", "handler", ".", "isConnectionAllowed", "(", "this", ")", ")", "{", ...
Call handlers and check if connection to the existing SO is allowed. @return is connection allowed
[ "Call", "handlers", "and", "check", "if", "connection", "to", "the", "existing", "SO", "is", "allowed", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L500-L518
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObjectScope.java
SharedObjectScope.isWriteAllowed
protected boolean isWriteAllowed(String key, Object value) { // check internal handlers first for (ISharedObjectSecurity handler : securityHandlers) { if (!handler.isWriteAllowed(this, key, value)) { return false; } } // check global SO hand...
java
protected boolean isWriteAllowed(String key, Object value) { // check internal handlers first for (ISharedObjectSecurity handler : securityHandlers) { if (!handler.isWriteAllowed(this, key, value)) { return false; } } // check global SO hand...
[ "protected", "boolean", "isWriteAllowed", "(", "String", "key", ",", "Object", "value", ")", "{", "// check internal handlers first\r", "for", "(", "ISharedObjectSecurity", "handler", ":", "securityHandlers", ")", "{", "if", "(", "!", "handler", ".", "isWriteAllowed...
Call handlers and check if writing to the SO is allowed. @param key key @param value value @return is write allowed
[ "Call", "handlers", "and", "check", "if", "writing", "to", "the", "SO", "is", "allowed", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L529-L547
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObjectScope.java
SharedObjectScope.isDeleteAllowed
protected boolean isDeleteAllowed(String key) { // check internal handlers first for (ISharedObjectSecurity handler : securityHandlers) { if (!handler.isDeleteAllowed(this, key)) { return false; } } // check global SO handlers next ...
java
protected boolean isDeleteAllowed(String key) { // check internal handlers first for (ISharedObjectSecurity handler : securityHandlers) { if (!handler.isDeleteAllowed(this, key)) { return false; } } // check global SO handlers next ...
[ "protected", "boolean", "isDeleteAllowed", "(", "String", "key", ")", "{", "// check internal handlers first\r", "for", "(", "ISharedObjectSecurity", "handler", ":", "securityHandlers", ")", "{", "if", "(", "!", "handler", ".", "isDeleteAllowed", "(", "this", ",", ...
Call handlers and check if deleting a property from the SO is allowed. @param key key @return is delete allowed
[ "Call", "handlers", "and", "check", "if", "deleting", "a", "property", "from", "the", "SO", "is", "allowed", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L556-L574
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObjectScope.java
SharedObjectScope.isSendAllowed
protected boolean isSendAllowed(String message, List<?> arguments) { // check internal handlers first for (ISharedObjectSecurity handler : securityHandlers) { if (!handler.isSendAllowed(this, message, arguments)) { return false; } } // check...
java
protected boolean isSendAllowed(String message, List<?> arguments) { // check internal handlers first for (ISharedObjectSecurity handler : securityHandlers) { if (!handler.isSendAllowed(this, message, arguments)) { return false; } } // check...
[ "protected", "boolean", "isSendAllowed", "(", "String", "message", ",", "List", "<", "?", ">", "arguments", ")", "{", "// check internal handlers first\r", "for", "(", "ISharedObjectSecurity", "handler", ":", "securityHandlers", ")", "{", "if", "(", "!", "handler"...
Call handlers and check if sending a message to the clients connected to the SO is allowed. @param message message @param arguments arguments @return is send allowed
[ "Call", "handlers", "and", "check", "if", "sending", "a", "message", "to", "the", "clients", "connected", "to", "the", "SO", "is", "allowed", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectScope.java#L585-L603
train
Red5/red5-server-common
src/main/java/org/red5/server/util/HttpConnectionUtil.java
HttpConnectionUtil.handleError
public static void handleError(HttpResponse response) throws ParseException, IOException { log.debug("{}", response.getStatusLine().toString()); HttpEntity entity = response.getEntity(); if (entity != null) { log.debug("{}", EntityUtils.toString(entity)); } }
java
public static void handleError(HttpResponse response) throws ParseException, IOException { log.debug("{}", response.getStatusLine().toString()); HttpEntity entity = response.getEntity(); if (entity != null) { log.debug("{}", EntityUtils.toString(entity)); } }
[ "public", "static", "void", "handleError", "(", "HttpResponse", "response", ")", "throws", "ParseException", ",", "IOException", "{", "log", ".", "debug", "(", "\"{}\"", ",", "response", ".", "getStatusLine", "(", ")", ".", "toString", "(", ")", ")", ";", ...
Logs details about the request error. @param response http response @throws IOException on IO error @throws ParseException on parse error
[ "Logs", "details", "about", "the", "request", "error", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/util/HttpConnectionUtil.java#L131-L137
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPUtils.java
RTMPUtils.writeReverseInt
public static void writeReverseInt(IoBuffer out, int value) { out.put((byte) (0xFF & value)); out.put((byte) (0xFF & (value >> 8))); out.put((byte) (0xFF & (value >> 16))); out.put((byte) (0xFF & (value >> 24))); }
java
public static void writeReverseInt(IoBuffer out, int value) { out.put((byte) (0xFF & value)); out.put((byte) (0xFF & (value >> 8))); out.put((byte) (0xFF & (value >> 16))); out.put((byte) (0xFF & (value >> 24))); }
[ "public", "static", "void", "writeReverseInt", "(", "IoBuffer", "out", ",", "int", "value", ")", "{", "out", ".", "put", "(", "(", "byte", ")", "(", "0xFF", "&", "value", ")", ")", ";", "out", ".", "put", "(", "(", "byte", ")", "(", "0xFF", "&", ...
Writes reversed integer to buffer. @param out Buffer @param value Integer to write
[ "Writes", "reversed", "integer", "to", "buffer", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L41-L46
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPUtils.java
RTMPUtils.readUnsignedMediumInt
public static int readUnsignedMediumInt(IoBuffer in) { final byte a = in.get(); final byte b = in.get(); final byte c = in.get(); int val = 0; val += (a & 0xff) << 16; val += (b & 0xff) << 8; val += (c & 0xff); return val; }
java
public static int readUnsignedMediumInt(IoBuffer in) { final byte a = in.get(); final byte b = in.get(); final byte c = in.get(); int val = 0; val += (a & 0xff) << 16; val += (b & 0xff) << 8; val += (c & 0xff); return val; }
[ "public", "static", "int", "readUnsignedMediumInt", "(", "IoBuffer", "in", ")", "{", "final", "byte", "a", "=", "in", ".", "get", "(", ")", ";", "final", "byte", "b", "=", "in", ".", "get", "(", ")", ";", "final", "byte", "c", "=", "in", ".", "ge...
Read unsigned 24 bit integer. @param in input @return unsigned int
[ "Read", "unsigned", "24", "bit", "integer", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L67-L76
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPUtils.java
RTMPUtils.readMediumInt
public static int readMediumInt(IoBuffer in) { final byte a = in.get(); final byte b = in.get(); final byte c = in.get(); // Fix unsigned values int val = 0; val += (a & 0xff) << 16; val += (b & 0xff) << 8; val += (c & 0xff); return val; ...
java
public static int readMediumInt(IoBuffer in) { final byte a = in.get(); final byte b = in.get(); final byte c = in.get(); // Fix unsigned values int val = 0; val += (a & 0xff) << 16; val += (b & 0xff) << 8; val += (c & 0xff); return val; ...
[ "public", "static", "int", "readMediumInt", "(", "IoBuffer", "in", ")", "{", "final", "byte", "a", "=", "in", ".", "get", "(", ")", ";", "final", "byte", "b", "=", "in", ".", "get", "(", ")", ";", "final", "byte", "c", "=", "in", ".", "get", "(...
Read 24 bit integer. @param in input @return signed 3 byte int
[ "Read", "24", "bit", "integer", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L85-L95
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPUtils.java
RTMPUtils.readReverseInt
public static int readReverseInt(IoBuffer in) { final byte a = in.get(); final byte b = in.get(); final byte c = in.get(); final byte d = in.get(); int val = 0; val += (d & 0xff) << 24; val += (c & 0xff) << 16; val += (b & 0xff) << 8; val ...
java
public static int readReverseInt(IoBuffer in) { final byte a = in.get(); final byte b = in.get(); final byte c = in.get(); final byte d = in.get(); int val = 0; val += (d & 0xff) << 24; val += (c & 0xff) << 16; val += (b & 0xff) << 8; val ...
[ "public", "static", "int", "readReverseInt", "(", "IoBuffer", "in", ")", "{", "final", "byte", "a", "=", "in", ".", "get", "(", ")", ";", "final", "byte", "b", "=", "in", ".", "get", "(", ")", ";", "final", "byte", "c", "=", "in", ".", "get", "...
Read integer in reversed order. @param in Input buffer @return Integer
[ "Read", "integer", "in", "reversed", "order", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L104-L115
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPUtils.java
RTMPUtils.encodeHeaderByte
public static void encodeHeaderByte(IoBuffer out, byte headerSize, int channelId) { if (channelId <= 63) { out.put((byte) ((headerSize << 6) + channelId)); } else if (channelId <= 319) { out.put((byte) (headerSize << 6)); out.put((byte) (channelId - 64)); ...
java
public static void encodeHeaderByte(IoBuffer out, byte headerSize, int channelId) { if (channelId <= 63) { out.put((byte) ((headerSize << 6) + channelId)); } else if (channelId <= 319) { out.put((byte) (headerSize << 6)); out.put((byte) (channelId - 64)); ...
[ "public", "static", "void", "encodeHeaderByte", "(", "IoBuffer", "out", ",", "byte", "headerSize", ",", "int", "channelId", ")", "{", "if", "(", "channelId", "<=", "63", ")", "{", "out", ".", "put", "(", "(", "byte", ")", "(", "(", "headerSize", "<<", ...
Encodes header size marker and channel id into header marker. @param out output buffer @param headerSize Header size marker @param channelId Channel used
[ "Encodes", "header", "size", "marker", "and", "channel", "id", "into", "header", "marker", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L124-L136
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPUtils.java
RTMPUtils.diffTimestamps
public static long diffTimestamps(final int a, final int b) { // first convert each to unsigned integers final long unsignedA = a & 0xFFFFFFFFL; final long unsignedB = b & 0xFFFFFFFFL; // then find the delta final long delta = unsignedA - unsignedB; return delta; ...
java
public static long diffTimestamps(final int a, final int b) { // first convert each to unsigned integers final long unsignedA = a & 0xFFFFFFFFL; final long unsignedB = b & 0xFFFFFFFFL; // then find the delta final long delta = unsignedA - unsignedB; return delta; ...
[ "public", "static", "long", "diffTimestamps", "(", "final", "int", "a", ",", "final", "int", "b", ")", "{", "// first convert each to unsigned integers\r", "final", "long", "unsignedA", "=", "a", "&", "0xFFFFFFFF", "L", ";", "final", "long", "unsignedB", "=", ...
Calculates the delta between two time stamps, adjusting for time stamp wrapping. @param a First time stamp @param b Second time stamp @return the distance between a and b, which will be negative if a is less than b.
[ "Calculates", "the", "delta", "between", "two", "time", "stamps", "adjusting", "for", "time", "stamp", "wrapping", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L219-L226
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.startWaitForHandshake
public void startWaitForHandshake() { if (log.isDebugEnabled()) { log.debug("startWaitForHandshake - {}", sessionId); } // start the handshake checker after maxHandshakeTimeout milliseconds if (scheduler != null) { try { waitForHandshakeTask...
java
public void startWaitForHandshake() { if (log.isDebugEnabled()) { log.debug("startWaitForHandshake - {}", sessionId); } // start the handshake checker after maxHandshakeTimeout milliseconds if (scheduler != null) { try { waitForHandshakeTask...
[ "public", "void", "startWaitForHandshake", "(", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "\"startWaitForHandshake - {}\"", ",", "sessionId", ")", ";", "}", "// start the handshake checker after maxHandshakeTime...
Start waiting for a valid handshake.
[ "Start", "waiting", "for", "a", "valid", "handshake", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L500-L512
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.stopWaitForHandshake
private void stopWaitForHandshake() { if (waitForHandshakeTask != null) { boolean cancelled = waitForHandshakeTask.cancel(true); waitForHandshakeTask = null; if (cancelled && log.isDebugEnabled()) { log.debug("waitForHandshake was cancelled for {}", sessi...
java
private void stopWaitForHandshake() { if (waitForHandshakeTask != null) { boolean cancelled = waitForHandshakeTask.cancel(true); waitForHandshakeTask = null; if (cancelled && log.isDebugEnabled()) { log.debug("waitForHandshake was cancelled for {}", sessi...
[ "private", "void", "stopWaitForHandshake", "(", ")", "{", "if", "(", "waitForHandshakeTask", "!=", "null", ")", "{", "boolean", "cancelled", "=", "waitForHandshakeTask", ".", "cancel", "(", "true", ")", ";", "waitForHandshakeTask", "=", "null", ";", "if", "(",...
Cancels wait for handshake task.
[ "Cancels", "wait", "for", "handshake", "task", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L517-L525
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.startRoundTripMeasurement
private void startRoundTripMeasurement() { if (scheduler != null) { if (pingInterval > 0) { if (log.isDebugEnabled()) { log.debug("startRoundTripMeasurement - {}", sessionId); } try { // schedule with an i...
java
private void startRoundTripMeasurement() { if (scheduler != null) { if (pingInterval > 0) { if (log.isDebugEnabled()) { log.debug("startRoundTripMeasurement - {}", sessionId); } try { // schedule with an i...
[ "private", "void", "startRoundTripMeasurement", "(", ")", "{", "if", "(", "scheduler", "!=", "null", ")", "{", "if", "(", "pingInterval", ">", "0", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "\"st...
Starts measurement.
[ "Starts", "measurement", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L530-L549
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.stopRoundTripMeasurement
private void stopRoundTripMeasurement() { if (keepAliveTask != null) { boolean cancelled = keepAliveTask.cancel(true); keepAliveTask = null; if (cancelled && log.isDebugEnabled()) { log.debug("Keep alive was cancelled for {}", sessionId); } ...
java
private void stopRoundTripMeasurement() { if (keepAliveTask != null) { boolean cancelled = keepAliveTask.cancel(true); keepAliveTask = null; if (cancelled && log.isDebugEnabled()) { log.debug("Keep alive was cancelled for {}", sessionId); } ...
[ "private", "void", "stopRoundTripMeasurement", "(", ")", "{", "if", "(", "keepAliveTask", "!=", "null", ")", "{", "boolean", "cancelled", "=", "keepAliveTask", ".", "cancel", "(", "true", ")", ";", "keepAliveTask", "=", "null", ";", "if", "(", "cancelled", ...
Stops measurement.
[ "Stops", "measurement", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L554-L562
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.setup
public void setup(String host, String path, Map<String, Object> params) { this.host = host; this.path = path; this.params = params; if (Integer.valueOf(3).equals(params.get("objectEncoding"))) { if (log.isDebugEnabled()) { log.debug("Setting object encod...
java
public void setup(String host, String path, Map<String, Object> params) { this.host = host; this.path = path; this.params = params; if (Integer.valueOf(3).equals(params.get("objectEncoding"))) { if (log.isDebugEnabled()) { log.debug("Setting object encod...
[ "public", "void", "setup", "(", "String", "host", ",", "String", "path", ",", "Map", "<", "String", ",", "Object", ">", "params", ")", "{", "this", ".", "host", "=", "host", ";", "this", ".", "path", "=", "path", ";", "this", ".", "params", "=", ...
Initialize connection. @param host Connection host @param path Connection path @param params Params passed from client
[ "Initialize", "connection", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L574-L584
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.getChannel
public Channel getChannel(int channelId) { Channel channel = channels.putIfAbsent(channelId, new Channel(this, channelId)); if (channel == null) { channel = channels.get(channelId); } return channel; }
java
public Channel getChannel(int channelId) { Channel channel = channels.putIfAbsent(channelId, new Channel(this, channelId)); if (channel == null) { channel = channels.get(channelId); } return channel; }
[ "public", "Channel", "getChannel", "(", "int", "channelId", ")", "{", "Channel", "channel", "=", "channels", ".", "putIfAbsent", "(", "channelId", ",", "new", "Channel", "(", "this", ",", "channelId", ")", ")", ";", "if", "(", "channel", "==", "null", ")...
Return channel by id. @param channelId Channel id @return Channel by id
[ "Return", "channel", "by", "id", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L626-L632
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.closeChannel
public void closeChannel(int channelId) { if (log.isTraceEnabled()) { log.trace("closeChannel: {}", channelId); } Channel chan = channels.remove(channelId); if (log.isTraceEnabled()) { log.trace("channel: {} for id: {}", chan, channelId); if (ch...
java
public void closeChannel(int channelId) { if (log.isTraceEnabled()) { log.trace("closeChannel: {}", channelId); } Channel chan = channels.remove(channelId); if (log.isTraceEnabled()) { log.trace("channel: {} for id: {}", chan, channelId); if (ch...
[ "public", "void", "closeChannel", "(", "int", "channelId", ")", "{", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ")", "{", "log", ".", "trace", "(", "\"closeChannel: {}\"", ",", "channelId", ")", ";", "}", "Channel", "chan", "=", "channels", ".", ...
Closes channel. @param channelId Channel id
[ "Closes", "channel", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L640-L665
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.isValidStreamId
public boolean isValidStreamId(Number streamId) { double d = streamId.doubleValue(); if (log.isTraceEnabled()) { log.trace("Checking validation for streamId {}; reservedStreams: {}; streams: {}, connection: {}", new Object[] { d, reservedStreams, streams, sessionId }); } ...
java
public boolean isValidStreamId(Number streamId) { double d = streamId.doubleValue(); if (log.isTraceEnabled()) { log.trace("Checking validation for streamId {}; reservedStreams: {}; streams: {}, connection: {}", new Object[] { d, reservedStreams, streams, sessionId }); } ...
[ "public", "boolean", "isValidStreamId", "(", "Number", "streamId", ")", "{", "double", "d", "=", "streamId", ".", "doubleValue", "(", ")", ";", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ")", "{", "log", ".", "trace", "(", "\"Checking validation fo...
Returns whether or not a given stream id is valid. @param streamId stream id @return true if its valid, false if its invalid
[ "Returns", "whether", "or", "not", "a", "given", "stream", "id", "is", "valid", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L712-L731
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.isIdle
public boolean isIdle() { long lastPingTime = lastPingSentOn.get(); long lastPongTime = lastPongReceivedOn.get(); boolean idle = (lastPongTime > 0 && (lastPingTime - lastPongTime > maxInactivity)); if (log.isTraceEnabled()) { log.trace("Connection {} {} idle", getSession...
java
public boolean isIdle() { long lastPingTime = lastPingSentOn.get(); long lastPongTime = lastPongReceivedOn.get(); boolean idle = (lastPongTime > 0 && (lastPingTime - lastPongTime > maxInactivity)); if (log.isTraceEnabled()) { log.trace("Connection {} {} idle", getSession...
[ "public", "boolean", "isIdle", "(", ")", "{", "long", "lastPingTime", "=", "lastPingSentOn", ".", "get", "(", ")", ";", "long", "lastPongTime", "=", "lastPongReceivedOn", ".", "get", "(", ")", ";", "boolean", "idle", "=", "(", "lastPongTime", ">", "0", "...
Returns whether or not the connection has been idle for a maximum period. @return true if max idle period has been exceeded, false otherwise
[ "Returns", "whether", "or", "not", "the", "connection", "has", "been", "idle", "for", "a", "maximum", "period", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L738-L746
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.getStreamIdForChannelId
public Number getStreamIdForChannelId(int channelId) { if (channelId < 4) { return 0; } Number streamId = Math.floor(((channelId - 4) / 5.0d) + 1); if (log.isTraceEnabled()) { log.trace("Stream id: {} requested for channel id: {}", streamId, channelId); ...
java
public Number getStreamIdForChannelId(int channelId) { if (channelId < 4) { return 0; } Number streamId = Math.floor(((channelId - 4) / 5.0d) + 1); if (log.isTraceEnabled()) { log.trace("Stream id: {} requested for channel id: {}", streamId, channelId); ...
[ "public", "Number", "getStreamIdForChannelId", "(", "int", "channelId", ")", "{", "if", "(", "channelId", "<", "4", ")", "{", "return", "0", ";", "}", "Number", "streamId", "=", "Math", ".", "floor", "(", "(", "(", "channelId", "-", "4", ")", "/", "5...
Return stream id for given channel id. @param channelId Channel id @return ID of stream that channel belongs to
[ "Return", "stream", "id", "for", "given", "channel", "id", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L834-L843
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.getStreamByChannelId
public IClientStream getStreamByChannelId(int channelId) { // channels 2 and 3 are "special" and don't have an IClientStream associated if (channelId < 4) { return null; } Number streamId = getStreamIdForChannelId(channelId); if (log.isTraceEnabled()) { ...
java
public IClientStream getStreamByChannelId(int channelId) { // channels 2 and 3 are "special" and don't have an IClientStream associated if (channelId < 4) { return null; } Number streamId = getStreamIdForChannelId(channelId); if (log.isTraceEnabled()) { ...
[ "public", "IClientStream", "getStreamByChannelId", "(", "int", "channelId", ")", "{", "// channels 2 and 3 are \"special\" and don't have an IClientStream associated\r", "if", "(", "channelId", "<", "4", ")", "{", "return", "null", ";", "}", "Number", "streamId", "=", "...
Return stream by given channel id. @param channelId Channel id @return Stream that channel belongs to
[ "Return", "stream", "by", "given", "channel", "id", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L852-L862
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.getChannelIdForStreamId
public int getChannelIdForStreamId(Number streamId) { int channelId = (int) (streamId.doubleValue() * 5) - 1; if (log.isTraceEnabled()) { log.trace("Channel id: {} requested for stream id: {}", channelId, streamId); } return channelId; }
java
public int getChannelIdForStreamId(Number streamId) { int channelId = (int) (streamId.doubleValue() * 5) - 1; if (log.isTraceEnabled()) { log.trace("Channel id: {} requested for stream id: {}", channelId, streamId); } return channelId; }
[ "public", "int", "getChannelIdForStreamId", "(", "Number", "streamId", ")", "{", "int", "channelId", "=", "(", "int", ")", "(", "streamId", ".", "doubleValue", "(", ")", "*", "5", ")", "-", "1", ";", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ...
Return channel id for given stream id. @param streamId Stream id @return ID of channel that belongs to the stream
[ "Return", "channel", "id", "for", "given", "stream", "id", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L871-L877
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.createOutputStream
public OutputStream createOutputStream(Number streamId) { int channelId = getChannelIdForStreamId(streamId); if (log.isTraceEnabled()) { log.trace("Create output - stream id: {} channel id: {}", streamId, channelId); } final Channel data = getChannel(channelId++); ...
java
public OutputStream createOutputStream(Number streamId) { int channelId = getChannelIdForStreamId(streamId); if (log.isTraceEnabled()) { log.trace("Create output - stream id: {} channel id: {}", streamId, channelId); } final Channel data = getChannel(channelId++); ...
[ "public", "OutputStream", "createOutputStream", "(", "Number", "streamId", ")", "{", "int", "channelId", "=", "getChannelIdForStreamId", "(", "streamId", ")", ";", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ")", "{", "log", ".", "trace", "(", "\"Crea...
Creates output stream object from stream id. Output stream consists of audio, video, and data channels. @see org.red5.server.stream.OutputStream @param streamId Stream id @return Output stream object
[ "Creates", "output", "stream", "object", "from", "stream", "id", ".", "Output", "stream", "consists", "of", "audio", "video", "and", "data", "channels", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L887-L899
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.customizeStream
private void customizeStream(Number streamId, AbstractClientStream stream) { Integer buffer = streamBuffers.get(streamId.doubleValue()); if (buffer != null) { stream.setClientBufferDuration(buffer); } stream.setName(createStreamName()); stream.setConnection(this...
java
private void customizeStream(Number streamId, AbstractClientStream stream) { Integer buffer = streamBuffers.get(streamId.doubleValue()); if (buffer != null) { stream.setClientBufferDuration(buffer); } stream.setName(createStreamName()); stream.setConnection(this...
[ "private", "void", "customizeStream", "(", "Number", "streamId", ",", "AbstractClientStream", "stream", ")", "{", "Integer", "buffer", "=", "streamBuffers", ".", "get", "(", "streamId", ".", "doubleValue", "(", ")", ")", ";", "if", "(", "buffer", "!=", "null...
Specify name, connection, scope and etc for stream @param streamId Stream id @param stream Stream
[ "Specify", "name", "connection", "scope", "and", "etc", "for", "stream" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L909-L918
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.registerStream
private boolean registerStream(IClientStream stream) { if (streams.putIfAbsent(stream.getStreamId().doubleValue(), stream) == null) { usedStreams.incrementAndGet(); return true; } log.error("Unable to register stream {}, stream with id {} was already added", stream, ...
java
private boolean registerStream(IClientStream stream) { if (streams.putIfAbsent(stream.getStreamId().doubleValue(), stream) == null) { usedStreams.incrementAndGet(); return true; } log.error("Unable to register stream {}, stream with id {} was already added", stream, ...
[ "private", "boolean", "registerStream", "(", "IClientStream", "stream", ")", "{", "if", "(", "streams", ".", "putIfAbsent", "(", "stream", ".", "getStreamId", "(", ")", ".", "doubleValue", "(", ")", ",", "stream", ")", "==", "null", ")", "{", "usedStreams"...
Store a stream in the connection. @param stream
[ "Store", "a", "stream", "in", "the", "connection", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L925-L932
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.updateBytesRead
protected void updateBytesRead() { if (log.isTraceEnabled()) { log.trace("updateBytesRead"); } long bytesRead = getReadBytes(); if (bytesRead >= nextBytesRead) { BytesRead sbr = new BytesRead((int) (bytesRead % Integer.MAX_VALUE)); getChannel(2)...
java
protected void updateBytesRead() { if (log.isTraceEnabled()) { log.trace("updateBytesRead"); } long bytesRead = getReadBytes(); if (bytesRead >= nextBytesRead) { BytesRead sbr = new BytesRead((int) (bytesRead % Integer.MAX_VALUE)); getChannel(2)...
[ "protected", "void", "updateBytesRead", "(", ")", "{", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ")", "{", "log", ".", "trace", "(", "\"updateBytesRead\"", ")", ";", "}", "long", "bytesRead", "=", "getReadBytes", "(", ")", ";", "if", "(", "byt...
Update number of bytes to read next value.
[ "Update", "number", "of", "bytes", "to", "read", "next", "value", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L1118-L1128
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.receivedBytesRead
public void receivedBytesRead(int bytes) { if (log.isDebugEnabled()) { log.debug("Client received {} bytes, written {} bytes, {} messages pending", new Object[] { bytes, getWrittenBytes(), getPendingMessages() }); } clientBytesRead.addAndGet(bytes); }
java
public void receivedBytesRead(int bytes) { if (log.isDebugEnabled()) { log.debug("Client received {} bytes, written {} bytes, {} messages pending", new Object[] { bytes, getWrittenBytes(), getPendingMessages() }); } clientBytesRead.addAndGet(bytes); }
[ "public", "void", "receivedBytesRead", "(", "int", "bytes", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "\"Client received {} bytes, written {} bytes, {} messages pending\"", ",", "new", "Object", "[", "]", "{...
Read number of received bytes. @param bytes Number of bytes
[ "Read", "number", "of", "received", "bytes", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L1136-L1141
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.writingMessage
protected void writingMessage(Packet message) { if (message.getMessage() instanceof VideoData) { Number streamId = message.getHeader().getStreamId(); final AtomicInteger value = new AtomicInteger(); AtomicInteger old = pendingVideos.putIfAbsent(streamId.doubleValue(), val...
java
protected void writingMessage(Packet message) { if (message.getMessage() instanceof VideoData) { Number streamId = message.getHeader().getStreamId(); final AtomicInteger value = new AtomicInteger(); AtomicInteger old = pendingVideos.putIfAbsent(streamId.doubleValue(), val...
[ "protected", "void", "writingMessage", "(", "Packet", "message", ")", "{", "if", "(", "message", ".", "getMessage", "(", ")", "instanceof", "VideoData", ")", "{", "Number", "streamId", "=", "message", ".", "getHeader", "(", ")", ".", "getStreamId", "(", ")...
Mark message as being written. @param message Message to mark
[ "Mark", "message", "as", "being", "written", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L1298-L1308
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.handleMessageReceived
public void handleMessageReceived(Packet packet) { if (log.isTraceEnabled()) { log.trace("handleMessageReceived - {}", sessionId); } // set the packet expiration time if maxHandlingTimeout is not disabled (set to 0) if (maxHandlingTimeout > 0) { packet.setEx...
java
public void handleMessageReceived(Packet packet) { if (log.isTraceEnabled()) { log.trace("handleMessageReceived - {}", sessionId); } // set the packet expiration time if maxHandlingTimeout is not disabled (set to 0) if (maxHandlingTimeout > 0) { packet.setEx...
[ "public", "void", "handleMessageReceived", "(", "Packet", "packet", ")", "{", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ")", "{", "log", ".", "trace", "(", "\"handleMessageReceived - {}\"", ",", "sessionId", ")", ";", "}", "// set the packet expiration ...
Handle the incoming message. @param packet incoming message packet
[ "Handle", "the", "incoming", "message", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L1370-L1442
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.messageSent
public void messageSent(Packet message) { if (message.getMessage() instanceof VideoData) { Number streamId = message.getHeader().getStreamId(); AtomicInteger pending = pendingVideos.get(streamId.doubleValue()); if (log.isTraceEnabled()) { log.trace("Strea...
java
public void messageSent(Packet message) { if (message.getMessage() instanceof VideoData) { Number streamId = message.getHeader().getStreamId(); AtomicInteger pending = pendingVideos.get(streamId.doubleValue()); if (log.isTraceEnabled()) { log.trace("Strea...
[ "public", "void", "messageSent", "(", "Packet", "message", ")", "{", "if", "(", "message", ".", "getMessage", "(", ")", "instanceof", "VideoData", ")", "{", "Number", "streamId", "=", "message", ".", "getHeader", "(", ")", ".", "getStreamId", "(", ")", "...
Mark message as sent. @param message Message to mark
[ "Mark", "message", "as", "sent", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L1521-L1533
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.sendSharedObjectMessage
public void sendSharedObjectMessage(String name, int currentVersion, boolean persistent, Set<ISharedObjectEvent> events) { // create a new sync message for every client to avoid concurrent access through multiple threads SharedObjectMessage syncMessage = state.getEncoding() == Encoding.AMF3 ? new Flex...
java
public void sendSharedObjectMessage(String name, int currentVersion, boolean persistent, Set<ISharedObjectEvent> events) { // create a new sync message for every client to avoid concurrent access through multiple threads SharedObjectMessage syncMessage = state.getEncoding() == Encoding.AMF3 ? new Flex...
[ "public", "void", "sendSharedObjectMessage", "(", "String", "name", ",", "int", "currentVersion", ",", "boolean", "persistent", ",", "Set", "<", "ISharedObjectEvent", ">", "events", ")", "{", "// create a new sync message for every client to avoid concurrent access through mu...
Send a shared object message. @param name shared object name @param currentVersion the current version @param persistent toggle @param events shared object events
[ "Send", "a", "shared", "object", "message", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L1573-L1587
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPConnection.java
RTMPConnection.pingReceived
public void pingReceived(Ping pong) { long now = System.currentTimeMillis(); long previousPingTime = lastPingSentOn.get(); int previousPingValue = (int) (previousPingTime & 0xffffffffL); int pongValue = pong.getValue2().intValue(); if (log.isDebugEnabled()) { lo...
java
public void pingReceived(Ping pong) { long now = System.currentTimeMillis(); long previousPingTime = lastPingSentOn.get(); int previousPingValue = (int) (previousPingTime & 0xffffffffL); int pongValue = pong.getValue2().intValue(); if (log.isDebugEnabled()) { lo...
[ "public", "void", "pingReceived", "(", "Ping", "pong", ")", "{", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "previousPingTime", "=", "lastPingSentOn", ".", "get", "(", ")", ";", "int", "previousPingValue", "=", "(", "int...
Marks that ping back was received. @param pong Ping object
[ "Marks", "that", "ping", "back", "was", "received", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L1612-L1633
train
metafacture/metafacture-core
metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java
SetMatcher.printAutomaton
public void printAutomaton(final PrintStream out) { out.println("digraph ahocorasick {"); printDebug(out, root); out.println("}"); }
java
public void printAutomaton(final PrintStream out) { out.println("digraph ahocorasick {"); printDebug(out, root); out.println("}"); }
[ "public", "void", "printAutomaton", "(", "final", "PrintStream", "out", ")", "{", "out", ".", "println", "(", "\"digraph ahocorasick {\"", ")", ";", "printDebug", "(", "out", ",", "root", ")", ";", "out", ".", "println", "(", "\"}\"", ")", ";", "}" ]
Prints dot description of the automaton to out for visualization in GraphViz. Used for debugging and education. @param out the stream t which the description is written
[ "Prints", "dot", "description", "of", "the", "automaton", "to", "out", "for", "visualization", "in", "GraphViz", ".", "Used", "for", "debugging", "and", "education", "." ]
cb43933ec8eb01a4ddce4019c14b2415cc441918
https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java#L135-L139
train
metafacture/metafacture-core
metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java
JsonEncoder.setJavaScriptEscapeChars
public void setJavaScriptEscapeChars(final int[] escapeCharacters) { final CharacterEscapes ce = new CharacterEscapes() { private static final long serialVersionUID = 1L; @Override public int[] getEscapeCodesForAscii() { if (escapeCharacters == null) { ...
java
public void setJavaScriptEscapeChars(final int[] escapeCharacters) { final CharacterEscapes ce = new CharacterEscapes() { private static final long serialVersionUID = 1L; @Override public int[] getEscapeCodesForAscii() { if (escapeCharacters == null) { ...
[ "public", "void", "setJavaScriptEscapeChars", "(", "final", "int", "[", "]", "escapeCharacters", ")", "{", "final", "CharacterEscapes", "ce", "=", "new", "CharacterEscapes", "(", ")", "{", "private", "static", "final", "long", "serialVersionUID", "=", "1L", ";",...
By default JSON output does only have escaping where it is strictly necessary. This is recommended in the most cases. Nevertheless it can be sometimes useful to have some more escaping. @param escapeCharacters an array which defines which characters should be escaped and how it will be done. See {@link CharacterEscape...
[ "By", "default", "JSON", "output", "does", "only", "have", "escaping", "where", "it", "is", "strictly", "necessary", ".", "This", "is", "recommended", "in", "the", "most", "cases", ".", "Nevertheless", "it", "can", "be", "sometimes", "useful", "to", "have", ...
cb43933ec8eb01a4ddce4019c14b2415cc441918
https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java#L92-L115
train
metafacture/metafacture-core
metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBuffer.java
StreamBuffer.replay
public void replay() { int index = 0; for (MessageType type : typeBuffer) { switch (type) { case RECORD_START: getReceiver().startRecord(valueBuffer.get(index)); ++index; break; case RECORD_END: getRecei...
java
public void replay() { int index = 0; for (MessageType type : typeBuffer) { switch (type) { case RECORD_START: getReceiver().startRecord(valueBuffer.get(index)); ++index; break; case RECORD_END: getRecei...
[ "public", "void", "replay", "(", ")", "{", "int", "index", "=", "0", ";", "for", "(", "MessageType", "type", ":", "typeBuffer", ")", "{", "switch", "(", "type", ")", "{", "case", "RECORD_START", ":", "getReceiver", "(", ")", ".", "startRecord", "(", ...
Replays the buffered event.
[ "Replays", "the", "buffered", "event", "." ]
cb43933ec8eb01a4ddce4019c14b2415cc441918
https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBuffer.java#L54-L80
train
metafacture/metafacture-core
metamorph/src/main/java/org/metafacture/metamorph/InlineMorph.java
InlineMorph.with
public InlineMorph with(String line) { if (scriptBuilder.length() == 0) { appendBoilerplate(line); } scriptBuilder .append(line) .append("\n"); return this; }
java
public InlineMorph with(String line) { if (scriptBuilder.length() == 0) { appendBoilerplate(line); } scriptBuilder .append(line) .append("\n"); return this; }
[ "public", "InlineMorph", "with", "(", "String", "line", ")", "{", "if", "(", "scriptBuilder", ".", "length", "(", ")", "==", "0", ")", "{", "appendBoilerplate", "(", "line", ")", ";", "}", "scriptBuilder", ".", "append", "(", "line", ")", ".", "append"...
Adds a line to the morph script. @param line the next line of the morph script @return a reference to {@code this} for continuation
[ "Adds", "a", "line", "to", "the", "morph", "script", "." ]
cb43933ec8eb01a4ddce4019c14b2415cc441918
https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metamorph/src/main/java/org/metafacture/metamorph/InlineMorph.java#L105-L113
train
metafacture/metafacture-core
metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java
StringUtil.repeatChars
public static String repeatChars(final char ch, final int count) { return CharBuffer.allocate(count).toString().replace('\0', ch); }
java
public static String repeatChars(final char ch, final int count) { return CharBuffer.allocate(count).toString().replace('\0', ch); }
[ "public", "static", "String", "repeatChars", "(", "final", "char", "ch", ",", "final", "int", "count", ")", "{", "return", "CharBuffer", ".", "allocate", "(", "count", ")", ".", "toString", "(", ")", ".", "replace", "(", "'", "'", ",", "ch", ")", ";"...
Creates a string which contains a sequence of repeated characters. @param ch to repeat @param count number of repetitions @return a string with {@code count} consisting only of {@code ch}
[ "Creates", "a", "string", "which", "contains", "a", "sequence", "of", "repeated", "characters", "." ]
cb43933ec8eb01a4ddce4019c14b2415cc441918
https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java#L155-L157
train
metafacture/metafacture-core
metafacture-mangling/src/main/java/org/metafacture/mangling/EntityPathTracker.java
EntityPathTracker.getCurrentPathWith
public String getCurrentPathWith(final String literalName) { if (entityStack.size() == 0) { return literalName; } return getCurrentPath() + entitySeparator + literalName; }
java
public String getCurrentPathWith(final String literalName) { if (entityStack.size() == 0) { return literalName; } return getCurrentPath() + entitySeparator + literalName; }
[ "public", "String", "getCurrentPathWith", "(", "final", "String", "literalName", ")", "{", "if", "(", "entityStack", ".", "size", "(", ")", "==", "0", ")", "{", "return", "literalName", ";", "}", "return", "getCurrentPath", "(", ")", "+", "entitySeparator", ...
Returns the current entity path with the given literal name appended. @param literalName the literal name to append to the current entity path. Must not be null. @return the current entity path with the literal name appended. The {@link #getEntitySeparator()} is used to separate both unless no entity was received yet ...
[ "Returns", "the", "current", "entity", "path", "with", "the", "given", "literal", "name", "appended", "." ]
cb43933ec8eb01a4ddce4019c14b2415cc441918
https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metafacture-mangling/src/main/java/org/metafacture/mangling/EntityPathTracker.java#L67-L72
train
metafacture/metafacture-core
metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Iso646ByteBuffer.java
Iso646ByteBuffer.stringAt
String stringAt(final int fromIndex, final int length, final Charset charset) { return new String(byteArray, fromIndex, length, charset); }
java
String stringAt(final int fromIndex, final int length, final Charset charset) { return new String(byteArray, fromIndex, length, charset); }
[ "String", "stringAt", "(", "final", "int", "fromIndex", ",", "final", "int", "length", ",", "final", "Charset", "charset", ")", "{", "return", "new", "String", "(", "byteArray", ",", "fromIndex", ",", "length", ",", "charset", ")", ";", "}" ]
Returns a string containing the characters in the specified part of the record. @param fromIndex index of the first byte of the string. @param length number of bytes to include in the string. If zero an empty string is returned. @param charset used for decoding the byte sequence into characters. It is callers responsi...
[ "Returns", "a", "string", "containing", "the", "characters", "in", "the", "specified", "part", "of", "the", "record", "." ]
cb43933ec8eb01a4ddce4019c14b2415cc441918
https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Iso646ByteBuffer.java#L138-L141
train
metafacture/metafacture-core
metafacture-triples/src/main/java/org/metafacture/triples/MemoryWarningSystem.java
MemoryWarningSystem.findTenuredGenPool
private static MemoryPoolMXBean findTenuredGenPool() { // I don't know whether this approach is better, or whether // we should rather check for the pool name "Tenured Gen"? for (final MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) if (pool.getType() == MemoryType....
java
private static MemoryPoolMXBean findTenuredGenPool() { // I don't know whether this approach is better, or whether // we should rather check for the pool name "Tenured Gen"? for (final MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) if (pool.getType() == MemoryType....
[ "private", "static", "MemoryPoolMXBean", "findTenuredGenPool", "(", ")", "{", "// I don't know whether this approach is better, or whether", "// we should rather check for the pool name \"Tenured Gen\"?", "for", "(", "final", "MemoryPoolMXBean", "pool", ":", "ManagementFactory", ".",...
Tenured Space Pool can be determined by it being of type HEAP and by it being possible to set the usage threshold. @return MXBean for the Tenured Space Pool
[ "Tenured", "Space", "Pool", "can", "be", "determined", "by", "it", "being", "of", "type", "HEAP", "and", "by", "it", "being", "possible", "to", "set", "the", "usage", "threshold", "." ]
cb43933ec8eb01a4ddce4019c14b2415cc441918
https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metafacture-triples/src/main/java/org/metafacture/triples/MemoryWarningSystem.java#L97-L105
train
pili-engineering/pili-sdk-java
src/main/java/com/qiniu/pili/Hub.java
Hub.listLive
public ListRet listLive(String prefix, int limit, String marker) throws PiliException { return list(true, prefix, limit, marker); }
java
public ListRet listLive(String prefix, int limit, String marker) throws PiliException { return list(true, prefix, limit, marker); }
[ "public", "ListRet", "listLive", "(", "String", "prefix", ",", "int", "limit", ",", "String", "marker", ")", "throws", "PiliException", "{", "return", "list", "(", "true", ",", "prefix", ",", "limit", ",", "marker", ")", ";", "}" ]
list streams which is live @param prefix @param limit @param marker @return @throws PiliException
[ "list", "streams", "which", "is", "live" ]
7abadbd2baaa389d226a6f9351d82e2e5a60fe32
https://github.com/pili-engineering/pili-sdk-java/blob/7abadbd2baaa389d226a6f9351d82e2e5a60fe32/src/main/java/com/qiniu/pili/Hub.java#L117-L119
train
pili-engineering/pili-sdk-java
src/main/java/com/qiniu/pili/Hub.java
Hub.batchLiveStatus
public BatchLiveStatus[] batchLiveStatus(String[] streamTitles) throws PiliException { String path = baseUrl + "/livestreams"; String json = gson.toJson(new BatchLiveStatusOptions(streamTitles)); try { String resp = cli.callWithJson(path, json); BatchLiveStatusRet ret = ...
java
public BatchLiveStatus[] batchLiveStatus(String[] streamTitles) throws PiliException { String path = baseUrl + "/livestreams"; String json = gson.toJson(new BatchLiveStatusOptions(streamTitles)); try { String resp = cli.callWithJson(path, json); BatchLiveStatusRet ret = ...
[ "public", "BatchLiveStatus", "[", "]", "batchLiveStatus", "(", "String", "[", "]", "streamTitles", ")", "throws", "PiliException", "{", "String", "path", "=", "baseUrl", "+", "\"/livestreams\"", ";", "String", "json", "=", "gson", ".", "toJson", "(", "new", ...
batch get live status @param streamTitles @return @throws PiliException
[ "batch", "get", "live", "status" ]
7abadbd2baaa389d226a6f9351d82e2e5a60fe32
https://github.com/pili-engineering/pili-sdk-java/blob/7abadbd2baaa389d226a6f9351d82e2e5a60fe32/src/main/java/com/qiniu/pili/Hub.java#L128-L141
train
pili-engineering/pili-sdk-java
src/main/java/com/qiniu/pili/Stream.java
Stream.info
public Stream info() throws PiliException { try { String resp = cli.callWithGet(baseUrl); StreamInfo ret = gson.fromJson(resp, StreamInfo.class); ret.setMeta(info.getHub(), info.getKey()); this.info = ret; return this; } catch (PiliException e)...
java
public Stream info() throws PiliException { try { String resp = cli.callWithGet(baseUrl); StreamInfo ret = gson.fromJson(resp, StreamInfo.class); ret.setMeta(info.getHub(), info.getKey()); this.info = ret; return this; } catch (PiliException e)...
[ "public", "Stream", "info", "(", ")", "throws", "PiliException", "{", "try", "{", "String", "resp", "=", "cli", ".", "callWithGet", "(", "baseUrl", ")", ";", "StreamInfo", "ret", "=", "gson", ".", "fromJson", "(", "resp", ",", "StreamInfo", ".", "class",...
fetch stream info @return @throws PiliException
[ "fetch", "stream", "info" ]
7abadbd2baaa389d226a6f9351d82e2e5a60fe32
https://github.com/pili-engineering/pili-sdk-java/blob/7abadbd2baaa389d226a6f9351d82e2e5a60fe32/src/main/java/com/qiniu/pili/Stream.java#L79-L91
train
pili-engineering/pili-sdk-java
src/main/java/com/qiniu/pili/Stream.java
Stream.liveStatus
public LiveStatus liveStatus() throws PiliException { String path = baseUrl + "/live"; try { String resp = cli.callWithGet(path); LiveStatus status = gson.fromJson(resp, LiveStatus.class); return status; } catch (PiliException e) { throw e; ...
java
public LiveStatus liveStatus() throws PiliException { String path = baseUrl + "/live"; try { String resp = cli.callWithGet(path); LiveStatus status = gson.fromJson(resp, LiveStatus.class); return status; } catch (PiliException e) { throw e; ...
[ "public", "LiveStatus", "liveStatus", "(", ")", "throws", "PiliException", "{", "String", "path", "=", "baseUrl", "+", "\"/live\"", ";", "try", "{", "String", "resp", "=", "cli", ".", "callWithGet", "(", "path", ")", ";", "LiveStatus", "status", "=", "gson...
get the status of live stream @return @throws PiliException
[ "get", "the", "status", "of", "live", "stream" ]
7abadbd2baaa389d226a6f9351d82e2e5a60fe32
https://github.com/pili-engineering/pili-sdk-java/blob/7abadbd2baaa389d226a6f9351d82e2e5a60fe32/src/main/java/com/qiniu/pili/Stream.java#L127-L138
train
pili-engineering/pili-sdk-java
src/main/java/com/qiniu/pili/Stream.java
Stream.save
public String save(SaveOptions opts) throws PiliException { String path = baseUrl + "/saveas"; String json = gson.toJson(opts); try { String resp = cli.callWithJson(path, json); SaveRet ret = gson.fromJson(resp, SaveRet.class); return ret.fname; } cat...
java
public String save(SaveOptions opts) throws PiliException { String path = baseUrl + "/saveas"; String json = gson.toJson(opts); try { String resp = cli.callWithJson(path, json); SaveRet ret = gson.fromJson(resp, SaveRet.class); return ret.fname; } cat...
[ "public", "String", "save", "(", "SaveOptions", "opts", ")", "throws", "PiliException", "{", "String", "path", "=", "baseUrl", "+", "\"/saveas\"", ";", "String", "json", "=", "gson", ".", "toJson", "(", "opts", ")", ";", "try", "{", "String", "resp", "="...
save playback with more options @param opts @return @throws PiliException
[ "save", "playback", "with", "more", "options" ]
7abadbd2baaa389d226a6f9351d82e2e5a60fe32
https://github.com/pili-engineering/pili-sdk-java/blob/7abadbd2baaa389d226a6f9351d82e2e5a60fe32/src/main/java/com/qiniu/pili/Stream.java#L160-L173
train
pili-engineering/pili-sdk-java
src/main/java/com/qiniu/pili/Stream.java
Stream.snapshot
public String snapshot(SnapshotOptions opts) throws PiliException { String path = baseUrl + "/snapshot"; String json = gson.toJson(opts); try { String resp = cli.callWithJson(path, json); SnapshotRet ret = gson.fromJson(resp, SnapshotRet.class); return ret.fna...
java
public String snapshot(SnapshotOptions opts) throws PiliException { String path = baseUrl + "/snapshot"; String json = gson.toJson(opts); try { String resp = cli.callWithJson(path, json); SnapshotRet ret = gson.fromJson(resp, SnapshotRet.class); return ret.fna...
[ "public", "String", "snapshot", "(", "SnapshotOptions", "opts", ")", "throws", "PiliException", "{", "String", "path", "=", "baseUrl", "+", "\"/snapshot\"", ";", "String", "json", "=", "gson", ".", "toJson", "(", "opts", ")", ";", "try", "{", "String", "re...
snapshot the live stream @param opts @return @throws PiliException
[ "snapshot", "the", "live", "stream" ]
7abadbd2baaa389d226a6f9351d82e2e5a60fe32
https://github.com/pili-engineering/pili-sdk-java/blob/7abadbd2baaa389d226a6f9351d82e2e5a60fe32/src/main/java/com/qiniu/pili/Stream.java#L200-L212
train
pili-engineering/pili-sdk-java
src/main/java/com/qiniu/pili/Stream.java
Stream.updateConverts
public void updateConverts(String[] profiles) throws PiliException { String path = baseUrl + "/converts"; String json = gson.toJson(new ConvertsOptions(profiles)); try { cli.callWithJson(path, json); } catch (PiliException e) { throw e; } catch (Exception ...
java
public void updateConverts(String[] profiles) throws PiliException { String path = baseUrl + "/converts"; String json = gson.toJson(new ConvertsOptions(profiles)); try { cli.callWithJson(path, json); } catch (PiliException e) { throw e; } catch (Exception ...
[ "public", "void", "updateConverts", "(", "String", "[", "]", "profiles", ")", "throws", "PiliException", "{", "String", "path", "=", "baseUrl", "+", "\"/converts\"", ";", "String", "json", "=", "gson", ".", "toJson", "(", "new", "ConvertsOptions", "(", "prof...
update convert configs @param profiles @throws PiliException
[ "update", "convert", "configs" ]
7abadbd2baaa389d226a6f9351d82e2e5a60fe32
https://github.com/pili-engineering/pili-sdk-java/blob/7abadbd2baaa389d226a6f9351d82e2e5a60fe32/src/main/java/com/qiniu/pili/Stream.java#L220-L231
train
pili-engineering/pili-sdk-java
src/main/java/com/qiniu/pili/Stream.java
Stream.historyRecord
public Record[] historyRecord(long start, long end) throws PiliException { String path = appendQuery(baseUrl + "/historyrecord", start, end); try { String resp = cli.callWithGet(path); HistoryRet ret = gson.fromJson(resp, HistoryRet.class); return ret.items; }...
java
public Record[] historyRecord(long start, long end) throws PiliException { String path = appendQuery(baseUrl + "/historyrecord", start, end); try { String resp = cli.callWithGet(path); HistoryRet ret = gson.fromJson(resp, HistoryRet.class); return ret.items; }...
[ "public", "Record", "[", "]", "historyRecord", "(", "long", "start", ",", "long", "end", ")", "throws", "PiliException", "{", "String", "path", "=", "appendQuery", "(", "baseUrl", "+", "\"/historyrecord\"", ",", "start", ",", "end", ")", ";", "try", "{", ...
query the stream history @param start @param end @return @throws PiliException
[ "query", "the", "stream", "history" ]
7abadbd2baaa389d226a6f9351d82e2e5a60fe32
https://github.com/pili-engineering/pili-sdk-java/blob/7abadbd2baaa389d226a6f9351d82e2e5a60fe32/src/main/java/com/qiniu/pili/Stream.java#L241-L252
train
twilio/authy-java
src/main/java/com/authy/api/Instance.java
Instance.toXML
public String toXML() { Error error = getError(); if (error != null) { return error.toXML(); } StringWriter sw = new StringWriter(); String xml = ""; try { JAXBContext context = JAXBContext.newInstance(this.getClass()); Marshaller ma...
java
public String toXML() { Error error = getError(); if (error != null) { return error.toXML(); } StringWriter sw = new StringWriter(); String xml = ""; try { JAXBContext context = JAXBContext.newInstance(this.getClass()); Marshaller ma...
[ "public", "String", "toXML", "(", ")", "{", "Error", "error", "=", "getError", "(", ")", ";", "if", "(", "error", "!=", "null", ")", "{", "return", "error", ".", "toXML", "(", ")", ";", "}", "StringWriter", "sw", "=", "new", "StringWriter", "(", ")...
Map a Token instance to its XML representation. @return a String with the description of this object in XML.
[ "Map", "a", "Token", "instance", "to", "its", "XML", "representation", "." ]
55e3a5ff57a93b3eb36f5b59e8824e60af2b8b91
https://github.com/twilio/authy-java/blob/55e3a5ff57a93b3eb36f5b59e8824e60af2b8b91/src/main/java/com/authy/api/Instance.java#L73-L93
train
twilio/authy-java
src/main/java/com/authy/api/OneTouch.java
OneTouch.sendApprovalRequest
public OneTouchResponse sendApprovalRequest(ApprovalRequestParams approvalRequestParams) throws AuthyException {//Integer userId, String message, HashMap<String, Object> options, Integer secondsToExpire) throws OneTouchException { JSONObject params = new JSONObject(); params.put("message",...
java
public OneTouchResponse sendApprovalRequest(ApprovalRequestParams approvalRequestParams) throws AuthyException {//Integer userId, String message, HashMap<String, Object> options, Integer secondsToExpire) throws OneTouchException { JSONObject params = new JSONObject(); params.put("message",...
[ "public", "OneTouchResponse", "sendApprovalRequest", "(", "ApprovalRequestParams", "approvalRequestParams", ")", "throws", "AuthyException", "{", "//Integer userId, String message, HashMap<String, Object> options, Integer secondsToExpire) throws OneTouchException {", "JSONObject", "params", ...
Sends the OneTouch's approval request to the Authy servers and returns the OneTouchResponse that comes back. @param approvalRequestParams The bean wrapping the user's Authy approval request built using the ApprovalRequest.Builder @return The bean wrapping the response from Authy's service.
[ "Sends", "the", "OneTouch", "s", "approval", "request", "to", "the", "Authy", "servers", "and", "returns", "the", "OneTouchResponse", "that", "comes", "back", "." ]
55e3a5ff57a93b3eb36f5b59e8824e60af2b8b91
https://github.com/twilio/authy-java/blob/55e3a5ff57a93b3eb36f5b59e8824e60af2b8b91/src/main/java/com/authy/api/OneTouch.java#L40-L79
train
twilio/authy-java
src/main/java/com/authy/api/Users.java
Users.requestStatus
public UserStatus requestStatus(int userId) throws AuthyException { final Response response = this.get(String.format(USER_STATUS_PATH, userId), null); UserStatus userStatus = userStatusFromJson(response); return userStatus; }
java
public UserStatus requestStatus(int userId) throws AuthyException { final Response response = this.get(String.format(USER_STATUS_PATH, userId), null); UserStatus userStatus = userStatusFromJson(response); return userStatus; }
[ "public", "UserStatus", "requestStatus", "(", "int", "userId", ")", "throws", "AuthyException", "{", "final", "Response", "response", "=", "this", ".", "get", "(", "String", ".", "format", "(", "USER_STATUS_PATH", ",", "userId", ")", ",", "null", ")", ";", ...
Get user status. @return object containing user status
[ "Get", "user", "status", "." ]
55e3a5ff57a93b3eb36f5b59e8824e60af2b8b91
https://github.com/twilio/authy-java/blob/55e3a5ff57a93b3eb36f5b59e8824e60af2b8b91/src/main/java/com/authy/api/Users.java#L125-L129
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/terms/TransportTermsByQueryAction.java
TransportTermsByQueryAction.doExecute
@Override protected void doExecute(Task task, TermsByQueryRequest request, ActionListener<TermsByQueryResponse> listener) { request.nowInMillis(System.currentTimeMillis()); // set time to be used in scripts super.doExecute(task, request, listener); }
java
@Override protected void doExecute(Task task, TermsByQueryRequest request, ActionListener<TermsByQueryResponse> listener) { request.nowInMillis(System.currentTimeMillis()); // set time to be used in scripts super.doExecute(task, request, listener); }
[ "@", "Override", "protected", "void", "doExecute", "(", "Task", "task", ",", "TermsByQueryRequest", "request", ",", "ActionListener", "<", "TermsByQueryResponse", ">", "listener", ")", "{", "request", ".", "nowInMillis", "(", "System", ".", "currentTimeMillis", "(...
Executes the actions.
[ "Executes", "the", "actions", "." ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/terms/TransportTermsByQueryAction.java#L108-L112
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/terms/TransportTermsByQueryAction.java
TransportTermsByQueryAction.shards
@Override protected GroupShardsIterator shards(ClusterState clusterState, TermsByQueryRequest request, String[] concreteIndices) { Map<String, Set<String>> routingMap = indexNameExpressionResolver.resolveSearchRouting(clusterState, request.routing(), request.indices()); return clusterService.operationRouting(...
java
@Override protected GroupShardsIterator shards(ClusterState clusterState, TermsByQueryRequest request, String[] concreteIndices) { Map<String, Set<String>> routingMap = indexNameExpressionResolver.resolveSearchRouting(clusterState, request.routing(), request.indices()); return clusterService.operationRouting(...
[ "@", "Override", "protected", "GroupShardsIterator", "shards", "(", "ClusterState", "clusterState", ",", "TermsByQueryRequest", "request", ",", "String", "[", "]", "concreteIndices", ")", "{", "Map", "<", "String", ",", "Set", "<", "String", ">", ">", "routingMa...
The shards this request will execute against.
[ "The", "shards", "this", "request", "will", "execute", "against", "." ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/terms/TransportTermsByQueryAction.java#L134-L138
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/terms/TermsByQueryRequest.java
TermsByQueryRequest.validate
@Override public ActionRequestValidationException validate() { ActionRequestValidationException validationException = super.validate(); if (termsEncoding != null && termsEncoding.equals(TermsEncoding.BYTES)) { if (maxTermsPerShard == null) { validationException = ValidateActions.addValidationErr...
java
@Override public ActionRequestValidationException validate() { ActionRequestValidationException validationException = super.validate(); if (termsEncoding != null && termsEncoding.equals(TermsEncoding.BYTES)) { if (maxTermsPerShard == null) { validationException = ValidateActions.addValidationErr...
[ "@", "Override", "public", "ActionRequestValidationException", "validate", "(", ")", "{", "ActionRequestValidationException", "validationException", "=", "super", ".", "validate", "(", ")", ";", "if", "(", "termsEncoding", "!=", "null", "&&", "termsEncoding", ".", "...
Validates the request @return null if valid, exception otherwise
[ "Validates", "the", "request" ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/terms/TermsByQueryRequest.java#L93-L102
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/admin/version/GetIndicesVersionResponse.java
GetIndicesVersionResponse.getVersion
public long getVersion() { long version = 1; ArrayList<String> indices = new ArrayList<>(getIndices().keySet()); Collections.sort(indices); for (String index : indices) { version = 31 * version + getIndices().get(index); } return version; }
java
public long getVersion() { long version = 1; ArrayList<String> indices = new ArrayList<>(getIndices().keySet()); Collections.sort(indices); for (String index : indices) { version = 31 * version + getIndices().get(index); } return version; }
[ "public", "long", "getVersion", "(", ")", "{", "long", "version", "=", "1", ";", "ArrayList", "<", "String", ">", "indices", "=", "new", "ArrayList", "<>", "(", "getIndices", "(", ")", ".", "keySet", "(", ")", ")", ";", "Collections", ".", "sort", "(...
Returns the version for the set of indices.
[ "Returns", "the", "version", "for", "the", "set", "of", "indices", "." ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/admin/version/GetIndicesVersionResponse.java#L50-L60
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/admin/version/GetIndicesVersionResponse.java
GetIndicesVersionResponse.getIndices
public Map<String, Long> getIndices() { if (indicesVersions != null) { return indicesVersions; } Map<String, Long> indicesVersions = Maps.newHashMap(); Set<String> indices = Sets.newHashSet(); for (ShardIndexVersion shard : shards) { indices.add(shard.getShardRouting().getIndex()); ...
java
public Map<String, Long> getIndices() { if (indicesVersions != null) { return indicesVersions; } Map<String, Long> indicesVersions = Maps.newHashMap(); Set<String> indices = Sets.newHashSet(); for (ShardIndexVersion shard : shards) { indices.add(shard.getShardRouting().getIndex()); ...
[ "public", "Map", "<", "String", ",", "Long", ">", "getIndices", "(", ")", "{", "if", "(", "indicesVersions", "!=", "null", ")", "{", "return", "indicesVersions", ";", "}", "Map", "<", "String", ",", "Long", ">", "indicesVersions", "=", "Maps", ".", "ne...
Returns a map with the version of each index.
[ "Returns", "a", "map", "with", "the", "version", "of", "each", "index", "." ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/admin/version/GetIndicesVersionResponse.java#L65-L87
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/admin/version/GetIndicesVersionResponse.java
GetIndicesVersionResponse.getIndexVersion
private long getIndexVersion(List<ShardIndexVersion> shards) { long version = 1; // order shards per their id before computing the hash Collections.sort(shards, new Comparator<ShardIndexVersion>() { @Override public int compare(ShardIndexVersion o1, ShardIndexVersion o2) { return o1.get...
java
private long getIndexVersion(List<ShardIndexVersion> shards) { long version = 1; // order shards per their id before computing the hash Collections.sort(shards, new Comparator<ShardIndexVersion>() { @Override public int compare(ShardIndexVersion o1, ShardIndexVersion o2) { return o1.get...
[ "private", "long", "getIndexVersion", "(", "List", "<", "ShardIndexVersion", ">", "shards", ")", "{", "long", "version", "=", "1", ";", "// order shards per their id before computing the hash", "Collections", ".", "sort", "(", "shards", ",", "new", "Comparator", "<"...
Computes a unique hash based on the version of the shards.
[ "Computes", "a", "unique", "hash", "based", "on", "the", "version", "of", "the", "shards", "." ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/admin/version/GetIndicesVersionResponse.java#L92-L109
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/coordinate/pipeline/NodePipelineManager.java
NodePipelineManager.execute
public void execute(NodeTaskContext context) { NodeTaskReporter taskReporter = new NodeTaskReporter(this); taskQueue = new ArrayDeque<>(tasks); if (!taskQueue.isEmpty()) { NodeTask task = taskQueue.poll(); task.execute(context, taskReporter); } else { // if the queue is empty, reports th...
java
public void execute(NodeTaskContext context) { NodeTaskReporter taskReporter = new NodeTaskReporter(this); taskQueue = new ArrayDeque<>(tasks); if (!taskQueue.isEmpty()) { NodeTask task = taskQueue.poll(); task.execute(context, taskReporter); } else { // if the queue is empty, reports th...
[ "public", "void", "execute", "(", "NodeTaskContext", "context", ")", "{", "NodeTaskReporter", "taskReporter", "=", "new", "NodeTaskReporter", "(", "this", ")", ";", "taskQueue", "=", "new", "ArrayDeque", "<>", "(", "tasks", ")", ";", "if", "(", "!", "taskQue...
Starts the execution of the pipeline
[ "Starts", "the", "execution", "of", "the", "pipeline" ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/coordinate/pipeline/NodePipelineManager.java#L51-L61
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinCache.java
FilterJoinCache.put
public void put(final long cacheKey, final FilterJoinTerms terms) { logger.debug("{}: New cache entry {}", Thread.currentThread().getName(), cacheKey); this.cache.put(cacheKey, new CacheEntry(terms.getEncodedTerms(), terms.getSize(), terms.isPruned())); }
java
public void put(final long cacheKey, final FilterJoinTerms terms) { logger.debug("{}: New cache entry {}", Thread.currentThread().getName(), cacheKey); this.cache.put(cacheKey, new CacheEntry(terms.getEncodedTerms(), terms.getSize(), terms.isPruned())); }
[ "public", "void", "put", "(", "final", "long", "cacheKey", ",", "final", "FilterJoinTerms", "terms", ")", "{", "logger", ".", "debug", "(", "\"{}: New cache entry {}\"", ",", "Thread", ".", "currentThread", "(", ")", ".", "getName", "(", ")", ",", "cacheKey"...
Caches the provided list of encoded terms for the given filter join node.
[ "Caches", "the", "provided", "list", "of", "encoded", "terms", "for", "the", "given", "filter", "join", "node", "." ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinCache.java#L76-L79
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/terms/TermsByQueryAction.java
TermsByQueryAction.transportOptions
@Override public TransportRequestOptions transportOptions(Settings settings) { return TransportRequestOptions.builder() .withType(TransportRequestOptions.Type.REG) .build(); }
java
@Override public TransportRequestOptions transportOptions(Settings settings) { return TransportRequestOptions.builder() .withType(TransportRequestOptions.Type.REG) .build(); }
[ "@", "Override", "public", "TransportRequestOptions", "transportOptions", "(", "Settings", "settings", ")", "{", "return", "TransportRequestOptions", ".", "builder", "(", ")", ".", "withType", "(", "TransportRequestOptions", ".", "Type", ".", "REG", ")", ".", "bui...
Set transport options specific to a terms by query request. Enabling compression here does not really reduce data transfer, even increase it on the contrary. @param settings node settings @return the request options.
[ "Set", "transport", "options", "specific", "to", "a", "terms", "by", "query", "request", ".", "Enabling", "compression", "here", "does", "not", "really", "reduce", "data", "transfer", "even", "increase", "it", "on", "the", "contrary", "." ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/terms/TermsByQueryAction.java#L58-L63
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java
FilterJoinVisitor.await
private void await() { try { // Clean up all filter join leaf nodes that have been converted boolean nodeRemoved = this.removeConvertedNodes(root); // If some nodes were removed, it means that we converted in the previous iteration // at least one filter join into a field data terms query. W...
java
private void await() { try { // Clean up all filter join leaf nodes that have been converted boolean nodeRemoved = this.removeConvertedNodes(root); // If some nodes were removed, it means that we converted in the previous iteration // at least one filter join into a field data terms query. W...
[ "private", "void", "await", "(", ")", "{", "try", "{", "// Clean up all filter join leaf nodes that have been converted", "boolean", "nodeRemoved", "=", "this", ".", "removeConvertedNodes", "(", "root", ")", ";", "// If some nodes were removed, it means that we converted in the...
Await for the completion of an async action.
[ "Await", "for", "the", "completion", "of", "an", "async", "action", "." ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java#L119-L137
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java
FilterJoinVisitor.removeConvertedNodes
private boolean removeConvertedNodes(AbstractNode node) { boolean nodeRemoved = false; Iterator<AbstractNode> it = node.getChildren().iterator(); while (it.hasNext()) { FilterJoinNode child = (FilterJoinNode) it.next(); if (child.getState().equals(FilterJoinNode.State.CONVERTED)) { it.re...
java
private boolean removeConvertedNodes(AbstractNode node) { boolean nodeRemoved = false; Iterator<AbstractNode> it = node.getChildren().iterator(); while (it.hasNext()) { FilterJoinNode child = (FilterJoinNode) it.next(); if (child.getState().equals(FilterJoinNode.State.CONVERTED)) { it.re...
[ "private", "boolean", "removeConvertedNodes", "(", "AbstractNode", "node", ")", "{", "boolean", "nodeRemoved", "=", "false", ";", "Iterator", "<", "AbstractNode", ">", "it", "=", "node", ".", "getChildren", "(", ")", ".", "iterator", "(", ")", ";", "while", ...
Removes all the filter join leaf nodes that were converted. Returns true if at least one node has been removed.
[ "Removes", "all", "the", "filter", "join", "leaf", "nodes", "that", "were", "converted", ".", "Returns", "true", "if", "at", "least", "one", "node", "has", "been", "removed", "." ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java#L143-L157
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java
FilterJoinVisitor.executeAsyncOperation
protected void executeAsyncOperation(final FilterJoinNode node) { logger.debug("Executing async actions"); node.setState(FilterJoinNode.State.RUNNING); // set state before execution to avoid race conditions with listener NodePipelineManager pipeline = new NodePipelineManager(); pipeline.addListener(new...
java
protected void executeAsyncOperation(final FilterJoinNode node) { logger.debug("Executing async actions"); node.setState(FilterJoinNode.State.RUNNING); // set state before execution to avoid race conditions with listener NodePipelineManager pipeline = new NodePipelineManager(); pipeline.addListener(new...
[ "protected", "void", "executeAsyncOperation", "(", "final", "FilterJoinNode", "node", ")", "{", "logger", ".", "debug", "(", "\"Executing async actions\"", ")", ";", "node", ".", "setState", "(", "FilterJoinNode", ".", "State", ".", "RUNNING", ")", ";", "// set ...
Executes the pipeline of async actions to compute the terms for this node.
[ "Executes", "the", "pipeline", "of", "async", "actions", "to", "compute", "the", "terms", "for", "this", "node", "." ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java#L193-L223
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java
FilterJoinVisitor.checkForFailure
private void checkForFailure(FilterJoinNode node) { if (node.hasFailure()) { logger.error("Node processing failed: {}", node.getFailure()); throw new ElasticsearchException("Unexpected failure while processing a node", node.getFailure()); } }
java
private void checkForFailure(FilterJoinNode node) { if (node.hasFailure()) { logger.error("Node processing failed: {}", node.getFailure()); throw new ElasticsearchException("Unexpected failure while processing a node", node.getFailure()); } }
[ "private", "void", "checkForFailure", "(", "FilterJoinNode", "node", ")", "{", "if", "(", "node", ".", "hasFailure", "(", ")", ")", "{", "logger", ".", "error", "(", "\"Node processing failed: {}\"", ",", "node", ".", "getFailure", "(", ")", ")", ";", "thr...
Checks for an action failure
[ "Checks", "for", "an", "action", "failure" ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java#L258-L263
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java
FilterJoinVisitor.convertToTermsQuery
private void convertToTermsQuery(FilterJoinNode node) { Map<String, Object> parent = node.getParentSourceMap(); FilterJoinTerms terms = node.getTerms(); BytesRef bytes = terms.getEncodedTerms(); // Remove the filter join from the parent parent.remove(FilterJoinBuilder.NAME); // Create the nest...
java
private void convertToTermsQuery(FilterJoinNode node) { Map<String, Object> parent = node.getParentSourceMap(); FilterJoinTerms terms = node.getTerms(); BytesRef bytes = terms.getEncodedTerms(); // Remove the filter join from the parent parent.remove(FilterJoinBuilder.NAME); // Create the nest...
[ "private", "void", "convertToTermsQuery", "(", "FilterJoinNode", "node", ")", "{", "Map", "<", "String", ",", "Object", ">", "parent", "=", "node", ".", "getParentSourceMap", "(", ")", ";", "FilterJoinTerms", "terms", "=", "node", ".", "getTerms", "(", ")", ...
Converts a filter join into a terms query.
[ "Converts", "a", "filter", "join", "into", "a", "terms", "query", "." ]
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java#L268-L304
train
sirensolutions/siren-join
src/main/java/solutions/siren/join/index/query/FieldDataTermsQuery.java
FieldDataTermsQuery.getTermsSet
protected synchronized NumericTermsSet getTermsSet() { if (encodedTerms != null) { // late decoding of the encoded terms long start = System.nanoTime(); termsSet = (NumericTermsSet) TermsSet.readFrom(new BytesRef(encodedTerms)); logger.debug("{}: Deserialized {} terms - took {} ms", new Object[] {...
java
protected synchronized NumericTermsSet getTermsSet() { if (encodedTerms != null) { // late decoding of the encoded terms long start = System.nanoTime(); termsSet = (NumericTermsSet) TermsSet.readFrom(new BytesRef(encodedTerms)); logger.debug("{}: Deserialized {} terms - took {} ms", new Object[] {...
[ "protected", "synchronized", "NumericTermsSet", "getTermsSet", "(", ")", "{", "if", "(", "encodedTerms", "!=", "null", ")", "{", "// late decoding of the encoded terms", "long", "start", "=", "System", ".", "nanoTime", "(", ")", ";", "termsSet", "=", "(", "Numer...
Returns the set of terms. This method will perform a late-decoding of the encoded terms, and will release the byte array. This method needs to be synchronized as each segment thread will call it concurrently.
[ "Returns", "the", "set", "of", "terms", ".", "This", "method", "will", "perform", "a", "late", "-", "decoding", "of", "the", "encoded", "terms", "and", "will", "release", "the", "byte", "array", ".", "This", "method", "needs", "to", "be", "synchronized", ...
cba1111b209ce6f72ab7750d5488a573a6c77fe5
https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/index/query/FieldDataTermsQuery.java#L137-L145
train
jruby/joni
src/org/joni/StackMachine.java
StackMachine.nullCheck
protected final int nullCheck(int id, int s) { int k = stk; while (true) { k--; StackEntry e = stack[k]; if (e.type == NULL_CHECK_START) { if (e.getNullCheckNum() == id) { return e.getNullCheckPStr() == s ? 1 : 0; }...
java
protected final int nullCheck(int id, int s) { int k = stk; while (true) { k--; StackEntry e = stack[k]; if (e.type == NULL_CHECK_START) { if (e.getNullCheckNum() == id) { return e.getNullCheckPStr() == s ? 1 : 0; }...
[ "protected", "final", "int", "nullCheck", "(", "int", "id", ",", "int", "s", ")", "{", "int", "k", "=", "stk", ";", "while", "(", "true", ")", "{", "k", "--", ";", "StackEntry", "e", "=", "stack", "[", "k", "]", ";", "if", "(", "e", ".", "typ...
int for consistency with other null check routines
[ "int", "for", "consistency", "with", "other", "null", "check", "routines" ]
182164fb64a9588ee5d866afa891a5edf597499b
https://github.com/jruby/joni/blob/182164fb64a9588ee5d866afa891a5edf597499b/src/org/joni/StackMachine.java#L442-L454
train
jruby/joni
src/org/joni/Lexer.java
Lexer.fetchNameForNoNamedGroup
private final int fetchNameForNoNamedGroup(int startCode, boolean ref) { int src = p; value = 0; int sign = 1; int endCode = nameEndCodePoint(startCode); int pnumHead = p; int nameEnd = stop; String err = null; if (!left()) { newValueExceptio...
java
private final int fetchNameForNoNamedGroup(int startCode, boolean ref) { int src = p; value = 0; int sign = 1; int endCode = nameEndCodePoint(startCode); int pnumHead = p; int nameEnd = stop; String err = null; if (!left()) { newValueExceptio...
[ "private", "final", "int", "fetchNameForNoNamedGroup", "(", "int", "startCode", ",", "boolean", "ref", ")", "{", "int", "src", "=", "p", ";", "value", "=", "0", ";", "int", "sign", "=", "1", ";", "int", "endCode", "=", "nameEndCodePoint", "(", "startCode...
make it return nameEnd!
[ "make", "it", "return", "nameEnd!" ]
182164fb64a9588ee5d866afa891a5edf597499b
https://github.com/jruby/joni/blob/182164fb64a9588ee5d866afa891a5edf597499b/src/org/joni/Lexer.java#L422-L478
train
ZuInnoTe/hadoopcryptoledger
hiveudf/src/main/java/org/zuinnote/hadoop/ethereum/hive/udf/EthereumUDFUtil.java
EthereumUDFUtil.getEthereumTransactionFromObject
public EthereumTransaction getEthereumTransactionFromObject(Object row) { EthereumTransaction result=null; if (row instanceof HiveEthereumTransaction) { // this is the case if you use the EthereumBlockSerde result=EthereumUDFUtil.convertToEthereumTransaction((HiveEthereumTransaction) row); } else { // this is...
java
public EthereumTransaction getEthereumTransactionFromObject(Object row) { EthereumTransaction result=null; if (row instanceof HiveEthereumTransaction) { // this is the case if you use the EthereumBlockSerde result=EthereumUDFUtil.convertToEthereumTransaction((HiveEthereumTransaction) row); } else { // this is...
[ "public", "EthereumTransaction", "getEthereumTransactionFromObject", "(", "Object", "row", ")", "{", "EthereumTransaction", "result", "=", "null", ";", "if", "(", "row", "instanceof", "HiveEthereumTransaction", ")", "{", "// this is the case if you use the EthereumBlockSerde"...
Create an object of type EthereumTransaction from any HiveTable @param row Object @return EthereumTransaction corresponding to object
[ "Create", "an", "object", "of", "type", "EthereumTransaction", "from", "any", "HiveTable" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/hiveudf/src/main/java/org/zuinnote/hadoop/ethereum/hive/udf/EthereumUDFUtil.java#L51-L93
train
ZuInnoTe/hadoopcryptoledger
hiveudf/src/main/java/org/zuinnote/hadoop/ethereum/hive/udf/EthereumUDFUtil.java
EthereumUDFUtil.convertToEthereumTransaction
public static EthereumTransaction convertToEthereumTransaction(HiveEthereumTransaction transaction) { EthereumTransaction result = new EthereumTransaction(); // note we set only the raw values, the other ones can be automatically dervied by the EthereumTransaction class if needed. This avoids conversion issues fo...
java
public static EthereumTransaction convertToEthereumTransaction(HiveEthereumTransaction transaction) { EthereumTransaction result = new EthereumTransaction(); // note we set only the raw values, the other ones can be automatically dervied by the EthereumTransaction class if needed. This avoids conversion issues fo...
[ "public", "static", "EthereumTransaction", "convertToEthereumTransaction", "(", "HiveEthereumTransaction", "transaction", ")", "{", "EthereumTransaction", "result", "=", "new", "EthereumTransaction", "(", ")", ";", "// note we set only the raw values, the other ones can be automati...
Convert HiveEthereumTransaction to Ethereum Transaction @param transaction in HiveEthereumTransaction format @return transaction in EthereumTransactionFormat
[ "Convert", "HiveEthereumTransaction", "to", "Ethereum", "Transaction" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/hiveudf/src/main/java/org/zuinnote/hadoop/ethereum/hive/udf/EthereumUDFUtil.java#L102-L115
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinUtil.java
BitcoinUtil.getSize
public static long getSize(byte[] byteSize) { if (byteSize.length!=4) { return 0; } ByteBuffer converterBuffer = ByteBuffer.wrap(byteSize); converterBuffer.order(ByteOrder.LITTLE_ENDIAN); return convertSignedIntToUnsigned(converterBuffer.getInt()); }
java
public static long getSize(byte[] byteSize) { if (byteSize.length!=4) { return 0; } ByteBuffer converterBuffer = ByteBuffer.wrap(byteSize); converterBuffer.order(ByteOrder.LITTLE_ENDIAN); return convertSignedIntToUnsigned(converterBuffer.getInt()); }
[ "public", "static", "long", "getSize", "(", "byte", "[", "]", "byteSize", ")", "{", "if", "(", "byteSize", ".", "length", "!=", "4", ")", "{", "return", "0", ";", "}", "ByteBuffer", "converterBuffer", "=", "ByteBuffer", ".", "wrap", "(", "byteSize", ")...
Reads a size from a reversed byte order, such as block size in the block header @param byteSize byte array with a length of exactly 4 @return size, returns 0 in case of invalid block size
[ "Reads", "a", "size", "from", "a", "reversed", "byte", "order", "such", "as", "block", "size", "in", "the", "block", "header" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinUtil.java#L258-L265
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinUtil.java
BitcoinUtil.reverseByteArray
public static byte[] reverseByteArray(byte[] inputByteArray) { byte[] result=new byte[inputByteArray.length]; for (int i=inputByteArray.length-1;i>=0;i--) { result[result.length-1-i]=inputByteArray[i]; } return result; }
java
public static byte[] reverseByteArray(byte[] inputByteArray) { byte[] result=new byte[inputByteArray.length]; for (int i=inputByteArray.length-1;i>=0;i--) { result[result.length-1-i]=inputByteArray[i]; } return result; }
[ "public", "static", "byte", "[", "]", "reverseByteArray", "(", "byte", "[", "]", "inputByteArray", ")", "{", "byte", "[", "]", "result", "=", "new", "byte", "[", "inputByteArray", ".", "length", "]", ";", "for", "(", "int", "i", "=", "inputByteArray", ...
Reverses the order of the byte array @param inputByteArray array to be reversed @return inputByteArray in reversed order
[ "Reverses", "the", "order", "of", "the", "byte", "array" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinUtil.java#L276-L282
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinUtil.java
BitcoinUtil.compareMagics
public static boolean compareMagics (byte[] magic1,byte[] magic2) { if (magic1.length!=magic2.length) { return false; } for (int i=0;i<magic1.length;i++) { if (magic1[i]!=magic2[i]) { return false; } } return true; }
java
public static boolean compareMagics (byte[] magic1,byte[] magic2) { if (magic1.length!=magic2.length) { return false; } for (int i=0;i<magic1.length;i++) { if (magic1[i]!=magic2[i]) { return false; } } return true; }
[ "public", "static", "boolean", "compareMagics", "(", "byte", "[", "]", "magic1", ",", "byte", "[", "]", "magic2", ")", "{", "if", "(", "magic1", ".", "length", "!=", "magic2", ".", "length", ")", "{", "return", "false", ";", "}", "for", "(", "int", ...
Compares two Bitcoin magics @param magic1 first magic @param magic2 second magics @return false, if do not match, true if match
[ "Compares", "two", "Bitcoin", "magics" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinUtil.java#L335-L346
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinUtil.java
BitcoinUtil.getTransactionHash
public static byte[] getTransactionHash(BitcoinTransaction transaction) throws IOException{ // convert transaction to byte array ByteArrayOutputStream transactionBAOS = new ByteArrayOutputStream(); byte[] version = reverseByteArray(convertIntToByteArray(transaction.getVersion())); transactionBAOS.write(version); ...
java
public static byte[] getTransactionHash(BitcoinTransaction transaction) throws IOException{ // convert transaction to byte array ByteArrayOutputStream transactionBAOS = new ByteArrayOutputStream(); byte[] version = reverseByteArray(convertIntToByteArray(transaction.getVersion())); transactionBAOS.write(version); ...
[ "public", "static", "byte", "[", "]", "getTransactionHash", "(", "BitcoinTransaction", "transaction", ")", "throws", "IOException", "{", "// convert transaction to byte array", "ByteArrayOutputStream", "transactionBAOS", "=", "new", "ByteArrayOutputStream", "(", ")", ";", ...
Calculates the double SHA256-Hash of a transaction in little endian format. This could be used for certain analysis scenario where one want to investigate the referenced transaction used as an input for a Transaction. Furthermore, it can be used as a unique identifier of the transaction It corresponds to the Bitcoin s...
[ "Calculates", "the", "double", "SHA256", "-", "Hash", "of", "a", "transaction", "in", "little", "endian", "format", ".", "This", "could", "be", "used", "for", "certain", "analysis", "scenario", "where", "one", "want", "to", "investigate", "the", "referenced", ...
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinUtil.java#L363-L399
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java
EthereumUtil.rlpDecodeNextItem
public static RLPObject rlpDecodeNextItem(ByteBuffer bb) { // detect object type RLPObject result=null; int objType = detectRLPObjectType(bb); switch (objType) { case EthereumUtil.RLP_OBJECTTYPE_ELEMENT: result=EthereumUtil.decodeRLPElement(bb); break; case EthereumUtil.RLP_OBJECTTYPE_...
java
public static RLPObject rlpDecodeNextItem(ByteBuffer bb) { // detect object type RLPObject result=null; int objType = detectRLPObjectType(bb); switch (objType) { case EthereumUtil.RLP_OBJECTTYPE_ELEMENT: result=EthereumUtil.decodeRLPElement(bb); break; case EthereumUtil.RLP_OBJECTTYPE_...
[ "public", "static", "RLPObject", "rlpDecodeNextItem", "(", "ByteBuffer", "bb", ")", "{", "// detect object type", "RLPObject", "result", "=", "null", ";", "int", "objType", "=", "detectRLPObjectType", "(", "bb", ")", ";", "switch", "(", "objType", ")", "{", "c...
Read RLP data from a Byte Buffer. @param bb ByteBuffer from which to read the RLP data @return RLPObject (e.g. RLPElement or RLPList) containing RLP data
[ "Read", "RLP", "data", "from", "a", "Byte", "Buffer", "." ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java#L76-L90
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java
EthereumUtil.detectRLPObjectType
public static int detectRLPObjectType(ByteBuffer bb) { bb.mark(); byte detector = bb.get(); int unsignedDetector=detector & 0xFF; int result = EthereumUtil.RLP_OBJECTTYPE_INVALID; if (unsignedDetector<=0x7f) { result=EthereumUtil.RLP_OBJECTTYPE_ELEMENT; } else if ((unsignedDetector>=0x80) && (unsignedDetector<...
java
public static int detectRLPObjectType(ByteBuffer bb) { bb.mark(); byte detector = bb.get(); int unsignedDetector=detector & 0xFF; int result = EthereumUtil.RLP_OBJECTTYPE_INVALID; if (unsignedDetector<=0x7f) { result=EthereumUtil.RLP_OBJECTTYPE_ELEMENT; } else if ((unsignedDetector>=0x80) && (unsignedDetector<...
[ "public", "static", "int", "detectRLPObjectType", "(", "ByteBuffer", "bb", ")", "{", "bb", ".", "mark", "(", ")", ";", "byte", "detector", "=", "bb", ".", "get", "(", ")", ";", "int", "unsignedDetector", "=", "detector", "&", "0xFF", ";", "int", "resul...
Detects the object type of an RLP encoded object. Note that it does not modify the read position in the ByteBuffer. @param bb ByteBuffer that contains RLP encoded object @return object type: EthereumUtil.RLP_OBJECTTYPE_ELEMENT or EthereumUtil.RLP_OBJECTTYPE_LIST or EthereumUtil.RLP_OBJECTTYPE_INVALID
[ "Detects", "the", "object", "type", "of", "an", "RLP", "encoded", "object", ".", "Note", "that", "it", "does", "not", "modify", "the", "read", "position", "in", "the", "ByteBuffer", "." ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java#L99-L126
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java
EthereumUtil.calculateChainId
public static Long calculateChainId(EthereumTransaction eTrans) { Long result=null; long rawResult=EthereumUtil.convertVarNumberToLong(new RLPElement(new byte[0],eTrans.getSig_v())); if (!((rawResult == EthereumUtil.LOWER_REAL_V) || (rawResult== (LOWER_REAL_V+1)))) { result = (rawResult-EthereumUtil.CHAIN_ID_IN...
java
public static Long calculateChainId(EthereumTransaction eTrans) { Long result=null; long rawResult=EthereumUtil.convertVarNumberToLong(new RLPElement(new byte[0],eTrans.getSig_v())); if (!((rawResult == EthereumUtil.LOWER_REAL_V) || (rawResult== (LOWER_REAL_V+1)))) { result = (rawResult-EthereumUtil.CHAIN_ID_IN...
[ "public", "static", "Long", "calculateChainId", "(", "EthereumTransaction", "eTrans", ")", "{", "Long", "result", "=", "null", ";", "long", "rawResult", "=", "EthereumUtil", ".", "convertVarNumberToLong", "(", "new", "RLPElement", "(", "new", "byte", "[", "0", ...
Calculates the chain Id @param eTrans Ethereum Transaction of which the chain id should be calculated @return chainId: 0, Ethereum testnet (aka Olympic); 1: Ethereum mainet (aka Frontier, Homestead, Metropolis) - also Classic (from fork) -also Expanse (alternative Ethereum implementation), 2 Morden (Ethereum testnet, ...
[ "Calculates", "the", "chain", "Id" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java#L364-L371
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java
EthereumUtil.convertToByte
public static Short convertToByte(RLPElement rpe) { Short result=0; if ((rpe.getRawData()!=null) || (rpe.getRawData().length==1)) { result=(short) ( rpe.getRawData()[0] & 0xFF); } return result; }
java
public static Short convertToByte(RLPElement rpe) { Short result=0; if ((rpe.getRawData()!=null) || (rpe.getRawData().length==1)) { result=(short) ( rpe.getRawData()[0] & 0xFF); } return result; }
[ "public", "static", "Short", "convertToByte", "(", "RLPElement", "rpe", ")", "{", "Short", "result", "=", "0", ";", "if", "(", "(", "rpe", ".", "getRawData", "(", ")", "!=", "null", ")", "||", "(", "rpe", ".", "getRawData", "(", ")", ".", "length", ...
Converts a byte in a RLPElement to byte @param rpe RLP element containing a raw byte @return short (=unsigned byte)
[ "Converts", "a", "byte", "in", "a", "RLPElement", "to", "byte" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java#L584-L590
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java
EthereumUtil.convertToShort
public static Integer convertToShort(RLPElement rpe) { Integer result=0; byte[] rawBytes=rpe.getRawData(); if ((rawBytes!=null)) { // fill leading zeros if (rawBytes.length<EthereumUtil.WORD_SIZE) { byte[] fullBytes=new byte[EthereumUtil.WORD_SIZE]; int dtDiff=EthereumUtil.WORD_SIZE-rawBytes.length; ...
java
public static Integer convertToShort(RLPElement rpe) { Integer result=0; byte[] rawBytes=rpe.getRawData(); if ((rawBytes!=null)) { // fill leading zeros if (rawBytes.length<EthereumUtil.WORD_SIZE) { byte[] fullBytes=new byte[EthereumUtil.WORD_SIZE]; int dtDiff=EthereumUtil.WORD_SIZE-rawBytes.length; ...
[ "public", "static", "Integer", "convertToShort", "(", "RLPElement", "rpe", ")", "{", "Integer", "result", "=", "0", ";", "byte", "[", "]", "rawBytes", "=", "rpe", ".", "getRawData", "(", ")", ";", "if", "(", "(", "rawBytes", "!=", "null", ")", ")", "...
Converts a short in a RLPElement to short @param rpe RLP element containing a raw short @return Integer (unsigned short) or null if not short
[ "Converts", "a", "short", "in", "a", "RLPElement", "to", "short" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java#L599-L617
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java
EthereumUtil.convertToInt
public static Long convertToInt(RLPElement rpe) { Long result=0L; byte[] rawBytes=rpe.getRawData(); if ((rawBytes!=null)) { // fill leading zeros if (rawBytes.length<EthereumUtil.INT_SIZE) { byte[] fullBytes=new byte[EthereumUtil.INT_SIZE]; int dtDiff=EthereumUtil.INT_SIZE-rawBytes.length; for (int...
java
public static Long convertToInt(RLPElement rpe) { Long result=0L; byte[] rawBytes=rpe.getRawData(); if ((rawBytes!=null)) { // fill leading zeros if (rawBytes.length<EthereumUtil.INT_SIZE) { byte[] fullBytes=new byte[EthereumUtil.INT_SIZE]; int dtDiff=EthereumUtil.INT_SIZE-rawBytes.length; for (int...
[ "public", "static", "Long", "convertToInt", "(", "RLPElement", "rpe", ")", "{", "Long", "result", "=", "0L", ";", "byte", "[", "]", "rawBytes", "=", "rpe", ".", "getRawData", "(", ")", ";", "if", "(", "(", "rawBytes", "!=", "null", ")", ")", "{", "...
Converts a int in a RLPElement to int @param rpe RLP element containing a raw int @return long (unsigned int) or null if not int
[ "Converts", "a", "int", "in", "a", "RLPElement", "to", "int" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java#L626-L643
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java
EthereumUtil.convertToLong
public static Long convertToLong(RLPElement rpe) { Long result=0L; byte[] rawBytes=rpe.getRawData(); if ((rawBytes!=null)) { // fill leading zeros if (rawBytes.length<EthereumUtil.LONG_SIZE) { byte[] fullBytes=new byte[EthereumUtil.LONG_SIZE]; int dtDiff=EthereumUtil.LONG_SIZE-rawBytes.length; for ...
java
public static Long convertToLong(RLPElement rpe) { Long result=0L; byte[] rawBytes=rpe.getRawData(); if ((rawBytes!=null)) { // fill leading zeros if (rawBytes.length<EthereumUtil.LONG_SIZE) { byte[] fullBytes=new byte[EthereumUtil.LONG_SIZE]; int dtDiff=EthereumUtil.LONG_SIZE-rawBytes.length; for ...
[ "public", "static", "Long", "convertToLong", "(", "RLPElement", "rpe", ")", "{", "Long", "result", "=", "0L", ";", "byte", "[", "]", "rawBytes", "=", "rpe", ".", "getRawData", "(", ")", ";", "if", "(", "(", "rawBytes", "!=", "null", ")", ")", "{", ...
Converts a long in a RLPElement to long @param rpe RLP element containing a raw long @return long or null if not long
[ "Converts", "a", "long", "in", "a", "RLPElement", "to", "long" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java#L652-L669
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java
BitcoinBlockReader.parseAuxPOWBranch
public BitcoinAuxPOWBranch parseAuxPOWBranch(ByteBuffer rawByteBuffer) { byte[] noOfLinksVarInt=BitcoinUtil.convertVarIntByteBufferToByteArray(rawByteBuffer); long currentNoOfLinks=BitcoinUtil.getVarInt(noOfLinksVarInt); ArrayList<byte[]> links = new ArrayList((int)currentNoOfLinks); for (int i=0;i<currentNoOfLink...
java
public BitcoinAuxPOWBranch parseAuxPOWBranch(ByteBuffer rawByteBuffer) { byte[] noOfLinksVarInt=BitcoinUtil.convertVarIntByteBufferToByteArray(rawByteBuffer); long currentNoOfLinks=BitcoinUtil.getVarInt(noOfLinksVarInt); ArrayList<byte[]> links = new ArrayList((int)currentNoOfLinks); for (int i=0;i<currentNoOfLink...
[ "public", "BitcoinAuxPOWBranch", "parseAuxPOWBranch", "(", "ByteBuffer", "rawByteBuffer", ")", "{", "byte", "[", "]", "noOfLinksVarInt", "=", "BitcoinUtil", ".", "convertVarIntByteBufferToByteArray", "(", "rawByteBuffer", ")", ";", "long", "currentNoOfLinks", "=", "Bitc...
Parse an AUXPowBranch @param rawByteBuffer ByteBuffer from which the AuxPOWBranch should be parsed @return AuxPOWBranch
[ "Parse", "an", "AUXPowBranch" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java#L260-L273
train
ZuInnoTe/hadoopcryptoledger
inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java
BitcoinBlockReader.parseTransactions
public List<BitcoinTransaction> parseTransactions(ByteBuffer rawByteBuffer,long noOfTransactions) { ArrayList<BitcoinTransaction> resultTransactions = new ArrayList<>((int)noOfTransactions); // read all transactions from ByteBuffer for (int k=0;k<noOfTransactions;k++) { // read version int currentVersion=rawByte...
java
public List<BitcoinTransaction> parseTransactions(ByteBuffer rawByteBuffer,long noOfTransactions) { ArrayList<BitcoinTransaction> resultTransactions = new ArrayList<>((int)noOfTransactions); // read all transactions from ByteBuffer for (int k=0;k<noOfTransactions;k++) { // read version int currentVersion=rawByte...
[ "public", "List", "<", "BitcoinTransaction", ">", "parseTransactions", "(", "ByteBuffer", "rawByteBuffer", ",", "long", "noOfTransactions", ")", "{", "ArrayList", "<", "BitcoinTransaction", ">", "resultTransactions", "=", "new", "ArrayList", "<>", "(", "(", "int", ...
Parses the Bitcoin transactions in a byte buffer. @param rawByteBuffer ByteBuffer from which the transactions have to be parsed @param noOfTransactions Number of expected transactions @return Array of transactions
[ "Parses", "the", "Bitcoin", "transactions", "in", "a", "byte", "buffer", "." ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java#L286-L361
train
ZuInnoTe/hadoopcryptoledger
examples/spark-bitcoinblock/src/main/java/org/zuinnote/spark/bitcoin/example/SparkBitcoinBlockCounter.java
SparkBitcoinBlockCounter.jobTotalNumOfTransactions
public static void jobTotalNumOfTransactions(JavaSparkContext sc, Configuration hadoopConf, String inputFile, String outputFile) { // read bitcoin data from HDFS JavaPairRDD<BytesWritable, BitcoinBlock> bitcoinBlocksRDD = sc.newAPIHadoopFile(inputFile, BitcoinBlockFileInputFormat.class, BytesWritable.class, Bit...
java
public static void jobTotalNumOfTransactions(JavaSparkContext sc, Configuration hadoopConf, String inputFile, String outputFile) { // read bitcoin data from HDFS JavaPairRDD<BytesWritable, BitcoinBlock> bitcoinBlocksRDD = sc.newAPIHadoopFile(inputFile, BitcoinBlockFileInputFormat.class, BytesWritable.class, Bit...
[ "public", "static", "void", "jobTotalNumOfTransactions", "(", "JavaSparkContext", "sc", ",", "Configuration", "hadoopConf", ",", "String", "inputFile", ",", "String", "outputFile", ")", "{", "// read bitcoin data from HDFS", "JavaPairRDD", "<", "BytesWritable", ",", "Bi...
a job for counting the total number of transactions @param sc context @param hadoopConf Configuration for input format @param inputFile Input file @param output outputFile file
[ "a", "job", "for", "counting", "the", "total", "number", "of", "transactions" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/examples/spark-bitcoinblock/src/main/java/org/zuinnote/spark/bitcoin/example/SparkBitcoinBlockCounter.java#L80-L99
train
ZuInnoTe/hadoopcryptoledger
examples/spark-bitcoinblock/src/main/java/org/zuinnote/spark/bitcoin/example/SparkBitcoinBlockCounter.java
SparkBitcoinBlockCounter.mapNoOfTransaction
public static Tuple2<String,Long> mapNoOfTransaction(BitcoinBlock block) { return new Tuple2<String, Long>("No of transactions: ",(long)(block.getTransactions().size())); }
java
public static Tuple2<String,Long> mapNoOfTransaction(BitcoinBlock block) { return new Tuple2<String, Long>("No of transactions: ",(long)(block.getTransactions().size())); }
[ "public", "static", "Tuple2", "<", "String", ",", "Long", ">", "mapNoOfTransaction", "(", "BitcoinBlock", "block", ")", "{", "return", "new", "Tuple2", "<", "String", ",", "Long", ">", "(", "\"No of transactions: \"", ",", "(", "long", ")", "(", "block", "...
Maps the number of transactions of a block to a tuple @param block Bitcoinblock @return Tuple containing the String "No of transactions. " and the number of transactions as long
[ "Maps", "the", "number", "of", "transactions", "of", "a", "block", "to", "a", "tuple" ]
5c9bfb61dd1a82374cd0de8413a7c66391ee4414
https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/examples/spark-bitcoinblock/src/main/java/org/zuinnote/spark/bitcoin/example/SparkBitcoinBlockCounter.java#L109-L111
train
CloudSlang/cs-actions
cs-amazon/src/main/java/io/cloudslang/content/amazon/actions/lambda/InvokeLambdaAction.java
InvokeLambdaAction.execute
@Action(name = "Invoke AWS Lambda Function", outputs = { @Output(Outputs.RETURN_CODE), @Output(Outputs.RETURN_RESULT), @Output(Outputs.EXCEPTION) }, responses = { @Response(text = Outputs.SUCCESS, field =...
java
@Action(name = "Invoke AWS Lambda Function", outputs = { @Output(Outputs.RETURN_CODE), @Output(Outputs.RETURN_RESULT), @Output(Outputs.EXCEPTION) }, responses = { @Response(text = Outputs.SUCCESS, field =...
[ "@", "Action", "(", "name", "=", "\"Invoke AWS Lambda Function\"", ",", "outputs", "=", "{", "@", "Output", "(", "Outputs", ".", "RETURN_CODE", ")", ",", "@", "Output", "(", "Outputs", ".", "RETURN_RESULT", ")", ",", "@", "Output", "(", "Outputs", ".", "...
Invokes an AWS Lambda Function in sync mode using AWS Java SDK @param identity Access key associated with your Amazon AWS or IAM account. Example: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" @param credential Secret access key ID associated with your Amazon AWS or IAM account. @param proxyHost O...
[ "Invokes", "an", "AWS", "Lambda", "Function", "in", "sync", "mode", "using", "AWS", "Java", "SDK" ]
9a1be1e99ad88286a6c153d5f2275df6ae1a57a1
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-amazon/src/main/java/io/cloudslang/content/amazon/actions/lambda/InvokeLambdaAction.java#L71-L123
train
CloudSlang/cs-actions
cs-vmware/src/main/java/io/cloudslang/content/vmware/actions/guest/CustomizeLinuxGuest.java
CustomizeLinuxGuest.customizeLinuxGuest
@Action(name = "Customize Linux Guest", outputs = { @Output(Outputs.RETURN_CODE), @Output(Outputs.RETURN_RESULT), @Output(Outputs.EXCEPTION) }, responses = { @Response(text = Outputs.SUCCESS, field = Outp...
java
@Action(name = "Customize Linux Guest", outputs = { @Output(Outputs.RETURN_CODE), @Output(Outputs.RETURN_RESULT), @Output(Outputs.EXCEPTION) }, responses = { @Response(text = Outputs.SUCCESS, field = Outp...
[ "@", "Action", "(", "name", "=", "\"Customize Linux Guest\"", ",", "outputs", "=", "{", "@", "Output", "(", "Outputs", ".", "RETURN_CODE", ")", ",", "@", "Output", "(", "Outputs", ".", "RETURN_RESULT", ")", ",", "@", "Output", "(", "Outputs", ".", "EXCEP...
Connects to specified data center and customize an existing linux OS based virtual machine identified by the inputs provided. @param host VMware host or IP - Example: "vc6.subdomain.example.com" @param port optional - the port to connect through - Examples: "443", "80" - Default: "443" @par...
[ "Connects", "to", "specified", "data", "center", "and", "customize", "an", "existing", "linux", "OS", "based", "virtual", "machine", "identified", "by", "the", "inputs", "provided", "." ]
9a1be1e99ad88286a6c153d5f2275df6ae1a57a1
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-vmware/src/main/java/io/cloudslang/content/vmware/actions/guest/CustomizeLinuxGuest.java#L66-L126
train
CloudSlang/cs-actions
cs-json/src/main/java/io/cloudslang/content/json/actions/ArraySize.java
ArraySize.execute
@Action(name = "Array Size", outputs = { @Output(OutputNames.RETURN_RESULT), @Output(OutputNames.RETURN_CODE), @Output(OutputNames.EXCEPTION) }, responses = { @Response(text = ResponseNames.SUCCESS, field...
java
@Action(name = "Array Size", outputs = { @Output(OutputNames.RETURN_RESULT), @Output(OutputNames.RETURN_CODE), @Output(OutputNames.EXCEPTION) }, responses = { @Response(text = ResponseNames.SUCCESS, field...
[ "@", "Action", "(", "name", "=", "\"Array Size\"", ",", "outputs", "=", "{", "@", "Output", "(", "OutputNames", ".", "RETURN_RESULT", ")", ",", "@", "Output", "(", "OutputNames", ".", "RETURN_CODE", ")", ",", "@", "Output", "(", "OutputNames", ".", "EXCE...
This operation determines the number of elements in the given JSON array. If an element is itself another JSON array, it only counts as 1 element; in other words, it will not expand and count embedded arrays. Null values are also considered to be an element. @param array The string representation of a JSON array obj...
[ "This", "operation", "determines", "the", "number", "of", "elements", "in", "the", "given", "JSON", "array", ".", "If", "an", "element", "is", "itself", "another", "JSON", "array", "it", "only", "counts", "as", "1", "element", ";", "in", "other", "words", ...
9a1be1e99ad88286a6c153d5f2275df6ae1a57a1
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-json/src/main/java/io/cloudslang/content/json/actions/ArraySize.java#L63-L96
train
CloudSlang/cs-actions
cs-powershell/src/main/java/io/cloudslang/content/utils/XMLUtils.java
XMLUtils.parseXml
public static String parseXml(String xml, String expression) throws ParserConfigurationException, IOException, XPathExpressionException, SAXException { DocumentBuilder builder = ResourceLoader.getDocumentBuilder(); Document document; try { document = builder.parse(new InputSource(new...
java
public static String parseXml(String xml, String expression) throws ParserConfigurationException, IOException, XPathExpressionException, SAXException { DocumentBuilder builder = ResourceLoader.getDocumentBuilder(); Document document; try { document = builder.parse(new InputSource(new...
[ "public", "static", "String", "parseXml", "(", "String", "xml", ",", "String", "expression", ")", "throws", "ParserConfigurationException", ",", "IOException", ",", "XPathExpressionException", ",", "SAXException", "{", "DocumentBuilder", "builder", "=", "ResourceLoader"...
Parse the content of the given xml input and evaluates the given XPath expression. @param xml The xml source. @param expression The XPath expression. @return Evaluate the XPath expression and return the result as a String. @throws ParserConfigurationException @throws IOException @throws XPathExpressionException...
[ "Parse", "the", "content", "of", "the", "given", "xml", "input", "and", "evaluates", "the", "given", "XPath", "expression", "." ]
9a1be1e99ad88286a6c153d5f2275df6ae1a57a1
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-powershell/src/main/java/io/cloudslang/content/utils/XMLUtils.java#L53-L63
train