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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
baratine/baratine | core/src/main/java/com/caucho/v5/bytecode/ByteCodeWriter.java | ByteCodeWriter.writeClass | public void writeClass(String className)
throws IOException
{
ConstantPool pool = _javaClass.getConstantPool();
ClassConstant classConst = pool.getClass(className);
if (classConst != null)
writeShort(classConst.getIndex());
else
writeShort(0);
} | java | public void writeClass(String className)
throws IOException
{
ConstantPool pool = _javaClass.getConstantPool();
ClassConstant classConst = pool.getClass(className);
if (classConst != null)
writeShort(classConst.getIndex());
else
writeShort(0);
} | [
"public",
"void",
"writeClass",
"(",
"String",
"className",
")",
"throws",
"IOException",
"{",
"ConstantPool",
"pool",
"=",
"_javaClass",
".",
"getConstantPool",
"(",
")",
";",
"ClassConstant",
"classConst",
"=",
"pool",
".",
"getClass",
"(",
"className",
")",
... | Writes a class constant. | [
"Writes",
"a",
"class",
"constant",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/ByteCodeWriter.java#L67-L77 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/bytecode/ByteCodeWriter.java | ByteCodeWriter.writeUTF8Const | public void writeUTF8Const(String value)
throws IOException
{
ConstantPool pool = _javaClass.getConstantPool();
Utf8Constant entry = pool.getUTF8(value);
if (entry != null)
writeShort(entry.getIndex());
else
throw new NullPointerException(L.l("utf8 constant {0} does not exist", value... | java | public void writeUTF8Const(String value)
throws IOException
{
ConstantPool pool = _javaClass.getConstantPool();
Utf8Constant entry = pool.getUTF8(value);
if (entry != null)
writeShort(entry.getIndex());
else
throw new NullPointerException(L.l("utf8 constant {0} does not exist", value... | [
"public",
"void",
"writeUTF8Const",
"(",
"String",
"value",
")",
"throws",
"IOException",
"{",
"ConstantPool",
"pool",
"=",
"_javaClass",
".",
"getConstantPool",
"(",
")",
";",
"Utf8Constant",
"entry",
"=",
"pool",
".",
"getUTF8",
"(",
"value",
")",
";",
"if... | Writes a UTF8 constant. | [
"Writes",
"a",
"UTF8",
"constant",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/ByteCodeWriter.java#L82-L92 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/bytecode/ByteCodeWriter.java | ByteCodeWriter.writeFloat | public void writeFloat(float v)
throws IOException
{
int bits = Float.floatToIntBits(v);
_os.write(bits >> 24);
_os.write(bits >> 16);
_os.write(bits >> 8);
_os.write(bits);
} | java | public void writeFloat(float v)
throws IOException
{
int bits = Float.floatToIntBits(v);
_os.write(bits >> 24);
_os.write(bits >> 16);
_os.write(bits >> 8);
_os.write(bits);
} | [
"public",
"void",
"writeFloat",
"(",
"float",
"v",
")",
"throws",
"IOException",
"{",
"int",
"bits",
"=",
"Float",
".",
"floatToIntBits",
"(",
"v",
")",
";",
"_os",
".",
"write",
"(",
"bits",
">>",
"24",
")",
";",
"_os",
".",
"write",
"(",
"bits",
... | Writes a float | [
"Writes",
"a",
"float"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/ByteCodeWriter.java#L154-L163 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/bytecode/ByteCodeWriter.java | ByteCodeWriter.writeDouble | public void writeDouble(double v)
throws IOException
{
long bits = Double.doubleToLongBits(v);
_os.write((int) (bits >> 56));
_os.write((int) (bits >> 48));
_os.write((int) (bits >> 40));
_os.write((int) (bits >> 32));
_os.write((int) (bits >> 24));
_os.write((int) (bits >> 1... | java | public void writeDouble(double v)
throws IOException
{
long bits = Double.doubleToLongBits(v);
_os.write((int) (bits >> 56));
_os.write((int) (bits >> 48));
_os.write((int) (bits >> 40));
_os.write((int) (bits >> 32));
_os.write((int) (bits >> 24));
_os.write((int) (bits >> 1... | [
"public",
"void",
"writeDouble",
"(",
"double",
"v",
")",
"throws",
"IOException",
"{",
"long",
"bits",
"=",
"Double",
".",
"doubleToLongBits",
"(",
"v",
")",
";",
"_os",
".",
"write",
"(",
"(",
"int",
")",
"(",
"bits",
">>",
"56",
")",
")",
";",
"... | Writes a double | [
"Writes",
"a",
"double"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/ByteCodeWriter.java#L168-L182 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/cli/spi/ArgsBase.java | ArgsBase.getDefaultArg | public String getDefaultArg()
{
String defaultArg = null;
if (_defaultArgs.length > 0) {
defaultArg = _defaultArgs[0];
}
return defaultArg;
} | java | public String getDefaultArg()
{
String defaultArg = null;
if (_defaultArgs.length > 0) {
defaultArg = _defaultArgs[0];
}
return defaultArg;
} | [
"public",
"String",
"getDefaultArg",
"(",
")",
"{",
"String",
"defaultArg",
"=",
"null",
";",
"if",
"(",
"_defaultArgs",
".",
"length",
">",
"0",
")",
"{",
"defaultArg",
"=",
"_defaultArgs",
"[",
"0",
"]",
";",
"}",
"return",
"defaultArg",
";",
"}"
] | finds first argument that follows no dash prefixed token
@return | [
"finds",
"first",
"argument",
"that",
"follows",
"no",
"dash",
"prefixed",
"token"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/cli/spi/ArgsBase.java#L615-L624 | train |
optimaize/anythingworks | client/soap/src/main/java/com/optimaize/anythingworks/client/soap/exensions/exceptiontranslation/SoapFaultExceptionTranslator.java | SoapFaultExceptionTranslator.detailChildrenIterator | private Iterator detailChildrenIterator(Detail detail) {
/*
sb.append("<ns2:AccessDeniedWebServiceException xmlns:ns2=\"http://exceptionthrower.system.services.v4_0.soap.server.nameapi.org/\">");
sb.append("<blame>CLIENT</blame>");
sb.append("<errorCode>2101</errorCode>");
sb.app... | java | private Iterator detailChildrenIterator(Detail detail) {
/*
sb.append("<ns2:AccessDeniedWebServiceException xmlns:ns2=\"http://exceptionthrower.system.services.v4_0.soap.server.nameapi.org/\">");
sb.append("<blame>CLIENT</blame>");
sb.append("<errorCode>2101</errorCode>");
sb.app... | [
"private",
"Iterator",
"detailChildrenIterator",
"(",
"Detail",
"detail",
")",
"{",
"/*\n sb.append(\"<ns2:AccessDeniedWebServiceException xmlns:ns2=\\\"http://exceptionthrower.system.services.v4_0.soap.server.nameapi.org/\\\">\");\n sb.append(\"<blame>CLIENT</blame>\");\n sb.ap... | It can either e within an extra tag, or directly. | [
"It",
"can",
"either",
"e",
"within",
"an",
"extra",
"tag",
"or",
"directly",
"."
] | 23e5f1c63cd56d935afaac4ad033c7996b32a1f2 | https://github.com/optimaize/anythingworks/blob/23e5f1c63cd56d935afaac4ad033c7996b32a1f2/client/soap/src/main/java/com/optimaize/anythingworks/client/soap/exensions/exceptiontranslation/SoapFaultExceptionTranslator.java#L95-L112 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/config/types/CronType.java | CronType.parseRange | private boolean[] parseRange(String range, int rangeMin, int rangeMax)
throws ConfigException
{
boolean[] values = new boolean[rangeMax + 1];
int j = 0;
while (j < range.length()) {
char ch = range.charAt(j);
int min = 0;
int max = 0;
int step = 1;
if (ch == '*') {
... | java | private boolean[] parseRange(String range, int rangeMin, int rangeMax)
throws ConfigException
{
boolean[] values = new boolean[rangeMax + 1];
int j = 0;
while (j < range.length()) {
char ch = range.charAt(j);
int min = 0;
int max = 0;
int step = 1;
if (ch == '*') {
... | [
"private",
"boolean",
"[",
"]",
"parseRange",
"(",
"String",
"range",
",",
"int",
"rangeMin",
",",
"int",
"rangeMax",
")",
"throws",
"ConfigException",
"{",
"boolean",
"[",
"]",
"values",
"=",
"new",
"boolean",
"[",
"rangeMax",
"+",
"1",
"]",
";",
"int",... | parses a range, following cron rules. | [
"parses",
"a",
"range",
"following",
"cron",
"rules",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/config/types/CronType.java#L141-L205 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.init | public void init(StreamImpl source)
{
_disableClose = false;
_isDisableCloseSource = false;
_readTime = 0;
if (_source != null && _source != source) {
close();
}
if (source == null) {
throw new IllegalArgumentException();
}
_source = source;
if (source.canRead()) {
... | java | public void init(StreamImpl source)
{
_disableClose = false;
_isDisableCloseSource = false;
_readTime = 0;
if (_source != null && _source != source) {
close();
}
if (source == null) {
throw new IllegalArgumentException();
}
_source = source;
if (source.canRead()) {
... | [
"public",
"void",
"init",
"(",
"StreamImpl",
"source",
")",
"{",
"_disableClose",
"=",
"false",
";",
"_isDisableCloseSource",
"=",
"false",
";",
"_readTime",
"=",
"0",
";",
"if",
"(",
"_source",
"!=",
"null",
"&&",
"_source",
"!=",
"source",
")",
"{",
"c... | Initializes the stream with a given source.
@param source Underlying source for the stream.
@param sibling Sibling write stream | [
"Initializes",
"the",
"stream",
"with",
"a",
"given",
"source",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L123-L150 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.setEncoding | public void setEncoding(String encoding)
throws UnsupportedEncodingException
{
String mimeName = Encoding.getMimeName(encoding);
if (mimeName != null && mimeName.equals(_readEncodingName))
return;
_readEncoding = Encoding.getReadEncoding(this, encoding);
_readEncodingName = mimeName;
} | java | public void setEncoding(String encoding)
throws UnsupportedEncodingException
{
String mimeName = Encoding.getMimeName(encoding);
if (mimeName != null && mimeName.equals(_readEncodingName))
return;
_readEncoding = Encoding.getReadEncoding(this, encoding);
_readEncodingName = mimeName;
} | [
"public",
"void",
"setEncoding",
"(",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"String",
"mimeName",
"=",
"Encoding",
".",
"getMimeName",
"(",
"encoding",
")",
";",
"if",
"(",
"mimeName",
"!=",
"null",
"&&",
"mimeName",
".",
"e... | Sets the current read encoding. The encoding can either be a
Java encoding name or a mime encoding.
@param encoding name of the read encoding | [
"Sets",
"the",
"current",
"read",
"encoding",
".",
"The",
"encoding",
"can",
"either",
"be",
"a",
"Java",
"encoding",
"name",
"or",
"a",
"mime",
"encoding",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L570-L580 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.readChar | public final int readChar() throws IOException
{
if (_readEncoding != null) {
int ch = _readEncoding.read();
return ch;
}
if (_readLength <= _readOffset) {
if (! readBuffer())
return -1;
}
return _readBuffer[_readOffset++] & 0xff;
} | java | public final int readChar() throws IOException
{
if (_readEncoding != null) {
int ch = _readEncoding.read();
return ch;
}
if (_readLength <= _readOffset) {
if (! readBuffer())
return -1;
}
return _readBuffer[_readOffset++] & 0xff;
} | [
"public",
"final",
"int",
"readChar",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_readEncoding",
"!=",
"null",
")",
"{",
"int",
"ch",
"=",
"_readEncoding",
".",
"read",
"(",
")",
";",
"return",
"ch",
";",
"}",
"if",
"(",
"_readLength",
"<=",
... | Reads a character from the stream, returning -1 on end of file. | [
"Reads",
"a",
"character",
"from",
"the",
"stream",
"returning",
"-",
"1",
"on",
"end",
"of",
"file",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L593-L606 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.read | public final int read(char []buf, int offset, int length)
throws IOException
{
if (_readEncoding != null) {
return _readEncoding.read(buf, offset, length);
}
byte []readBuffer = _readBuffer;
if (readBuffer == null)
return -1;
int readOffset = _readOffset;
int readLength = _re... | java | public final int read(char []buf, int offset, int length)
throws IOException
{
if (_readEncoding != null) {
return _readEncoding.read(buf, offset, length);
}
byte []readBuffer = _readBuffer;
if (readBuffer == null)
return -1;
int readOffset = _readOffset;
int readLength = _re... | [
"public",
"final",
"int",
"read",
"(",
"char",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_readEncoding",
"!=",
"null",
")",
"{",
"return",
"_readEncoding",
".",
"read",
"(",
"buf",
",",
... | Reads into a character buffer from the stream. Like the byte
array version, read may return less characters even though more
characters are available.
@param buf character buffer to fill
@param offset starting offset into the character buffer
@param length maximum number of characters to read
@return number of charac... | [
"Reads",
"into",
"a",
"character",
"buffer",
"from",
"the",
"stream",
".",
"Like",
"the",
"byte",
"array",
"version",
"read",
"may",
"return",
"less",
"characters",
"even",
"though",
"more",
"characters",
"are",
"available",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L618-L652 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.read | public int read(CharBuffer buf, int length) throws IOException
{
int len = buf.length();
buf.length(len + length);
int readLength = read(buf.buffer(), len, length);
if (readLength < 0) {
buf.length(len);
}
else if (readLength < length) {
buf.length(len + readLength);
... | java | public int read(CharBuffer buf, int length) throws IOException
{
int len = buf.length();
buf.length(len + length);
int readLength = read(buf.buffer(), len, length);
if (readLength < 0) {
buf.length(len);
}
else if (readLength < length) {
buf.length(len + readLength);
... | [
"public",
"int",
"read",
"(",
"CharBuffer",
"buf",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"int",
"len",
"=",
"buf",
".",
"length",
"(",
")",
";",
"buf",
".",
"length",
"(",
"len",
"+",
"length",
")",
";",
"int",
"readLength",
"=",
... | Reads characters from the stream, appending to the character buffer.
@param buf character buffer to fill
@param length maximum number of characters to read
@return number of characters read or -1 on end of file. | [
"Reads",
"characters",
"from",
"the",
"stream",
"appending",
"to",
"the",
"character",
"buffer",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L689-L705 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.readInt | public int readInt()
throws IOException
{
if (_readOffset + 4 < _readLength) {
return (((_readBuffer[_readOffset++] & 0xff) << 24)
+ ((_readBuffer[_readOffset++] & 0xff) << 16)
+ ((_readBuffer[_readOffset++] & 0xff) << 8)
+ ((_readBuffer[_readOffset++] & 0xff)))... | java | public int readInt()
throws IOException
{
if (_readOffset + 4 < _readLength) {
return (((_readBuffer[_readOffset++] & 0xff) << 24)
+ ((_readBuffer[_readOffset++] & 0xff) << 16)
+ ((_readBuffer[_readOffset++] & 0xff) << 8)
+ ((_readBuffer[_readOffset++] & 0xff)))... | [
"public",
"int",
"readInt",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_readOffset",
"+",
"4",
"<",
"_readLength",
")",
"{",
"return",
"(",
"(",
"(",
"_readBuffer",
"[",
"_readOffset",
"++",
"]",
"&",
"0xff",
")",
"<<",
"24",
")",
"+",
"(",
... | Reads a 4-byte network encoded integer | [
"Reads",
"a",
"4",
"-",
"byte",
"network",
"encoded",
"integer"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L979-L994 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.readUTF8ByByteLength | public int readUTF8ByByteLength(char []buffer, int offset, int byteLength)
throws IOException
{
int k = 0;
for (int i = 0; i < byteLength; i++) {
if (_readLength <= _readOffset) {
readBuffer();
}
int ch = _readBuffer[_readOffset++] & 0xff;
if (ch < 0x80) {
buffer[... | java | public int readUTF8ByByteLength(char []buffer, int offset, int byteLength)
throws IOException
{
int k = 0;
for (int i = 0; i < byteLength; i++) {
if (_readLength <= _readOffset) {
readBuffer();
}
int ch = _readBuffer[_readOffset++] & 0xff;
if (ch < 0x80) {
buffer[... | [
"public",
"int",
"readUTF8ByByteLength",
"(",
"char",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"byteLength",
")",
"throws",
"IOException",
"{",
"int",
"k",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"byteLength",
";"... | Reads a utf-8 string | [
"Reads",
"a",
"utf",
"-",
"8",
"string"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L1015-L1046 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java | ReadStreamOld.fillIfLive | public boolean fillIfLive(long timeout)
throws IOException
{
StreamImpl source = _source;
byte []readBuffer = _readBuffer;
if (readBuffer == null || source == null) {
_readOffset = 0;
_readLength = 0;
return false;
}
if (_readOffset > 0) {
System.arraycopy(readBuffer,... | java | public boolean fillIfLive(long timeout)
throws IOException
{
StreamImpl source = _source;
byte []readBuffer = _readBuffer;
if (readBuffer == null || source == null) {
_readOffset = 0;
_readLength = 0;
return false;
}
if (_readOffset > 0) {
System.arraycopy(readBuffer,... | [
"public",
"boolean",
"fillIfLive",
"(",
"long",
"timeout",
")",
"throws",
"IOException",
"{",
"StreamImpl",
"source",
"=",
"_source",
";",
"byte",
"[",
"]",
"readBuffer",
"=",
"_readBuffer",
";",
"if",
"(",
"readBuffer",
"==",
"null",
"||",
"source",
"==",
... | Fills the buffer with a timed read, testing for the end of file.
Used for cases like comet to test if the read stream has closed.
@param timeout the timeout in milliseconds for the next data
@return true on data or timeout, false on end of file | [
"Fills",
"the",
"buffer",
"with",
"a",
"timed",
"read",
"testing",
"for",
"the",
"end",
"of",
"file",
".",
"Used",
"for",
"cases",
"like",
"comet",
"to",
"test",
"if",
"the",
"read",
"stream",
"has",
"closed",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/ReadStreamOld.java#L1210-L1254 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/SocketWrapperBar.java | SocketWrapperBar.isSecure | @Override
public boolean isSecure()
{
if (_s == null || _sslSocketClass == null)
return false;
else
return _sslSocketClass.isAssignableFrom(_s.getClass());
} | java | @Override
public boolean isSecure()
{
if (_s == null || _sslSocketClass == null)
return false;
else
return _sslSocketClass.isAssignableFrom(_s.getClass());
} | [
"@",
"Override",
"public",
"boolean",
"isSecure",
"(",
")",
"{",
"if",
"(",
"_s",
"==",
"null",
"||",
"_sslSocketClass",
"==",
"null",
")",
"return",
"false",
";",
"else",
"return",
"_sslSocketClass",
".",
"isAssignableFrom",
"(",
"_s",
".",
"getClass",
"(... | Returns true if the connection is secure. | [
"Returns",
"true",
"if",
"the",
"connection",
"is",
"secure",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/SocketWrapperBar.java#L241-L248 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/SocketWrapperBar.java | SocketWrapperBar.cipherBits | @Override
public int cipherBits()
{
if (! (_s instanceof SSLSocket))
return super.cipherBits();
SSLSocket sslSocket = (SSLSocket) _s;
SSLSession sslSession = sslSocket.getSession();
if (sslSession != null)
return _sslKeySizes.get(sslSession.getCipherSuite());
else
... | java | @Override
public int cipherBits()
{
if (! (_s instanceof SSLSocket))
return super.cipherBits();
SSLSocket sslSocket = (SSLSocket) _s;
SSLSession sslSession = sslSocket.getSession();
if (sslSession != null)
return _sslKeySizes.get(sslSession.getCipherSuite());
else
... | [
"@",
"Override",
"public",
"int",
"cipherBits",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"_s",
"instanceof",
"SSLSocket",
")",
")",
"return",
"super",
".",
"cipherBits",
"(",
")",
";",
"SSLSocket",
"sslSocket",
"=",
"(",
"SSLSocket",
")",
"_s",
";",
"SSLSes... | Returns the bits in the socket. | [
"Returns",
"the",
"bits",
"in",
"the",
"socket",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/SocketWrapperBar.java#L274-L288 | train |
baratine/baratine | plugins/src/main/java/com/caucho/junit/HttpClient.java | HttpClient.postMultipart | public void postMultipart(String url, Map<String,String> map)
throws Exception
{
String boundaryStr = "-----boundary0";
StringBuilder sb = new StringBuilder();
map.forEach((k, v) -> {
sb.append(boundaryStr + "\r");
sb.append("Content-Disposition: form-data; name=\"" + k + "\"\r");
... | java | public void postMultipart(String url, Map<String,String> map)
throws Exception
{
String boundaryStr = "-----boundary0";
StringBuilder sb = new StringBuilder();
map.forEach((k, v) -> {
sb.append(boundaryStr + "\r");
sb.append("Content-Disposition: form-data; name=\"" + k + "\"\r");
... | [
"public",
"void",
"postMultipart",
"(",
"String",
"url",
",",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"throws",
"Exception",
"{",
"String",
"boundaryStr",
"=",
"\"-----boundary0\"",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
... | Performs multipart post
@param url
@param map
@throws Exception | [
"Performs",
"multipart",
"post"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/plugins/src/main/java/com/caucho/junit/HttpClient.java#L298-L327 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/profile/ProfilerServiceImpl.java | ProfilerServiceImpl.setBackgroundInterval | public void setBackgroundInterval(long interval, TimeUnit unit)
{
if (! isValid()) {
return;
}
long period = unit.toMillis(interval);
if (_state == StateProfile.IDLE) {
if (period > 0) {
_profileTask.setPeriod(period);
_profileTask.start();
_state... | java | public void setBackgroundInterval(long interval, TimeUnit unit)
{
if (! isValid()) {
return;
}
long period = unit.toMillis(interval);
if (_state == StateProfile.IDLE) {
if (period > 0) {
_profileTask.setPeriod(period);
_profileTask.start();
_state... | [
"public",
"void",
"setBackgroundInterval",
"(",
"long",
"interval",
",",
"TimeUnit",
"unit",
")",
"{",
"if",
"(",
"!",
"isValid",
"(",
")",
")",
"{",
"return",
";",
"}",
"long",
"period",
"=",
"unit",
".",
"toMillis",
"(",
"interval",
")",
";",
"if",
... | Sets the time interval for the background profile. | [
"Sets",
"the",
"time",
"interval",
"for",
"the",
"background",
"profile",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/profile/ProfilerServiceImpl.java#L30-L60 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/profile/ProfilerServiceImpl.java | ProfilerServiceImpl.start | public void start(long interval, TimeUnit unit)
{
if (! isValid()) {
return;
}
long period = unit.toMillis(interval);
if (period < 0) {
return;
}
_profileTask.stop();
_profileTask.setPeriod(period);
_profileTask.start();
_state = StateProfile.ACTIVE;... | java | public void start(long interval, TimeUnit unit)
{
if (! isValid()) {
return;
}
long period = unit.toMillis(interval);
if (period < 0) {
return;
}
_profileTask.stop();
_profileTask.setPeriod(period);
_profileTask.start();
_state = StateProfile.ACTIVE;... | [
"public",
"void",
"start",
"(",
"long",
"interval",
",",
"TimeUnit",
"unit",
")",
"{",
"if",
"(",
"!",
"isValid",
"(",
")",
")",
"{",
"return",
";",
"}",
"long",
"period",
"=",
"unit",
".",
"toMillis",
"(",
"interval",
")",
";",
"if",
"(",
"period"... | Starts a dedicated profile. | [
"Starts",
"a",
"dedicated",
"profile",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/profile/ProfilerServiceImpl.java#L111-L128 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/profile/ProfilerServiceImpl.java | ProfilerServiceImpl.stop | public ProfileReport stop()
{
if (! isValid()) {
return null;
}
if (_state != StateProfile.ACTIVE) {
return null;
}
_profileTask.stop();
ProfileReport report = _profileTask.getReport();
if (_backgroundPeriod > 0) {
_profileTask.setPeriod(_backgroundPer... | java | public ProfileReport stop()
{
if (! isValid()) {
return null;
}
if (_state != StateProfile.ACTIVE) {
return null;
}
_profileTask.stop();
ProfileReport report = _profileTask.getReport();
if (_backgroundPeriod > 0) {
_profileTask.setPeriod(_backgroundPer... | [
"public",
"ProfileReport",
"stop",
"(",
")",
"{",
"if",
"(",
"!",
"isValid",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"_state",
"!=",
"StateProfile",
".",
"ACTIVE",
")",
"{",
"return",
"null",
";",
"}",
"_profileTask",
".",
"stop",
... | Ends the dedicated profile, restarting the background. | [
"Ends",
"the",
"dedicated",
"profile",
"restarting",
"the",
"background",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/profile/ProfilerServiceImpl.java#L133-L157 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/pod/MethodPod.java | MethodPod.findLocalMethod | private MethodRefAmp findLocalMethod()
{
ServiceRefAmp serviceRefLocal = _serviceRef.getLocalService();
if (serviceRefLocal == null) {
return null;
}
if (_type != null) {
return serviceRefLocal.methodByName(_name, _type);
}
else {
return serviceRefLocal.methodByName(_na... | java | private MethodRefAmp findLocalMethod()
{
ServiceRefAmp serviceRefLocal = _serviceRef.getLocalService();
if (serviceRefLocal == null) {
return null;
}
if (_type != null) {
return serviceRefLocal.methodByName(_name, _type);
}
else {
return serviceRefLocal.methodByName(_na... | [
"private",
"MethodRefAmp",
"findLocalMethod",
"(",
")",
"{",
"ServiceRefAmp",
"serviceRefLocal",
"=",
"_serviceRef",
".",
"getLocalService",
"(",
")",
";",
"if",
"(",
"serviceRefLocal",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"_type",
... | Return the local method for this pod method, when the pod is on the
same jvm. | [
"Return",
"the",
"local",
"method",
"for",
"this",
"pod",
"method",
"when",
"the",
"pod",
"is",
"on",
"the",
"same",
"jvm",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/MethodPod.java#L296-L310 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/pod/MethodPod.java | MethodPod.createMethodRefActive | private MethodRefActive createMethodRefActive(ServiceRefAmp serviceRef)
{
MethodRefAmp methodRef;
if (_type != null) {
methodRef = serviceRef.methodByName(_name, _type);
}
else {
methodRef = serviceRef.methodByName(_name);
}
MethodShim methodShim;
ClassLoader met... | java | private MethodRefActive createMethodRefActive(ServiceRefAmp serviceRef)
{
MethodRefAmp methodRef;
if (_type != null) {
methodRef = serviceRef.methodByName(_name, _type);
}
else {
methodRef = serviceRef.methodByName(_name);
}
MethodShim methodShim;
ClassLoader met... | [
"private",
"MethodRefActive",
"createMethodRefActive",
"(",
"ServiceRefAmp",
"serviceRef",
")",
"{",
"MethodRefAmp",
"methodRef",
";",
"if",
"(",
"_type",
"!=",
"null",
")",
"{",
"methodRef",
"=",
"serviceRef",
".",
"methodByName",
"(",
"_name",
",",
"_type",
")... | Create an MethodRefActive for the given serviceRef.
The MethodRefActive contains the methodRef and the cross-pod
marshal/serialization shim. | [
"Create",
"an",
"MethodRefActive",
"for",
"the",
"given",
"serviceRef",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/MethodPod.java#L373-L411 | train |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/util/ModelConversion.java | ModelConversion.getProviderFromTemplate | private IProvider getProviderFromTemplate(eu.atos.sla.parser.data.wsag.Template templateXML) throws ModelConversionException {
Context context = templateXML.getContext();
String provider = null;
try {
ServiceProvider ctxProvider = ServiceProvider.fromString(context.... | java | private IProvider getProviderFromTemplate(eu.atos.sla.parser.data.wsag.Template templateXML) throws ModelConversionException {
Context context = templateXML.getContext();
String provider = null;
try {
ServiceProvider ctxProvider = ServiceProvider.fromString(context.... | [
"private",
"IProvider",
"getProviderFromTemplate",
"(",
"eu",
".",
"atos",
".",
"sla",
".",
"parser",
".",
"data",
".",
"wsag",
".",
"Template",
"templateXML",
")",
"throws",
"ModelConversionException",
"{",
"Context",
"context",
"=",
"templateXML",
".",
"getCon... | we retrieve the providerUUID from the template and get the provider object from the database | [
"we",
"retrieve",
"the",
"providerUUID",
"from",
"the",
"template",
"and",
"get",
"the",
"provider",
"object",
"from",
"the",
"database"
] | b199fe6de2c63b808cb248d3aca947d802375df8 | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/util/ModelConversion.java#L265-L286 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/TempStream.java | TempStream.write | @Override
public void write(byte []buf, int offset, int length, boolean isEnd)
throws IOException
{
while (length > 0) {
if (_tail == null) {
addBuffer(TempBuffer.create());
}
else if (_tail.buffer().length <= _tail.length()) {
addBuffer(TempBuffer.create());
}
... | java | @Override
public void write(byte []buf, int offset, int length, boolean isEnd)
throws IOException
{
while (length > 0) {
if (_tail == null) {
addBuffer(TempBuffer.create());
}
else if (_tail.buffer().length <= _tail.length()) {
addBuffer(TempBuffer.create());
}
... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"length",
",",
"boolean",
"isEnd",
")",
"throws",
"IOException",
"{",
"while",
"(",
"length",
">",
"0",
")",
"{",
"if",
"(",
"_tail",
"==",
... | Writes a chunk of data to the temp stream. | [
"Writes",
"a",
"chunk",
"of",
"data",
"to",
"the",
"temp",
"stream",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/TempStream.java#L91-L113 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/TempStream.java | TempStream.copy | public TempStream copy()
{
TempStream newStream = new TempStream();
TempBuffer ptr = _head;
for (; ptr != null; ptr = ptr.next()) {
TempBuffer newPtr = TempBuffer.create();
if (newStream._tail != null)
newStream._tail.next(newPtr);
else
newStream._head = newPtr;
... | java | public TempStream copy()
{
TempStream newStream = new TempStream();
TempBuffer ptr = _head;
for (; ptr != null; ptr = ptr.next()) {
TempBuffer newPtr = TempBuffer.create();
if (newStream._tail != null)
newStream._tail.next(newPtr);
else
newStream._head = newPtr;
... | [
"public",
"TempStream",
"copy",
"(",
")",
"{",
"TempStream",
"newStream",
"=",
"new",
"TempStream",
"(",
")",
";",
"TempBuffer",
"ptr",
"=",
"_head",
";",
"for",
"(",
";",
"ptr",
"!=",
"null",
";",
"ptr",
"=",
"ptr",
".",
"next",
"(",
")",
")",
"{"... | Copies the temp stream; | [
"Copies",
"the",
"temp",
"stream",
";"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/TempStream.java#L264-L283 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/http/log/AccessLogWriter.java | AccessLogWriter.flush | @Override
public void flush()
{
// server/021g
_logWriterQueue.wake();
waitForFlush(10);
try {
super.flush();
} catch (IOException e) {
log.log(Level.FINER, e.toString(), e);
}
} | java | @Override
public void flush()
{
// server/021g
_logWriterQueue.wake();
waitForFlush(10);
try {
super.flush();
} catch (IOException e) {
log.log(Level.FINER, e.toString(), e);
}
} | [
"@",
"Override",
"public",
"void",
"flush",
"(",
")",
"{",
"// server/021g",
"_logWriterQueue",
".",
"wake",
"(",
")",
";",
"waitForFlush",
"(",
"10",
")",
";",
"try",
"{",
"super",
".",
"flush",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
... | must be synchronized by _bufferLock. | [
"must",
"be",
"synchronized",
"by",
"_bufferLock",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/log/AccessLogWriter.java#L141-L154 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/deploy2/DeployService2Impl.java | DeployService2Impl.isModified | public boolean isModified()
{
I instance = _instance;
if (instance == null) {
return true;
}
if (DeployMode.MANUAL.equals(_strategy.redeployMode())) {
return false;
}
return instance.isModified();
} | java | public boolean isModified()
{
I instance = _instance;
if (instance == null) {
return true;
}
if (DeployMode.MANUAL.equals(_strategy.redeployMode())) {
return false;
}
return instance.isModified();
} | [
"public",
"boolean",
"isModified",
"(",
")",
"{",
"I",
"instance",
"=",
"_instance",
";",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"DeployMode",
".",
"MANUAL",
".",
"equals",
"(",
"_strategy",
".",
"redeploy... | Returns true if the entry is modified. | [
"Returns",
"true",
"if",
"the",
"entry",
"is",
"modified",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/deploy2/DeployService2Impl.java#L152-L165 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/deploy2/DeployService2Impl.java | DeployService2Impl.startOnInit | public void startOnInit(Result<I> result)
{
DeployFactory2<I> builder = builder();
if (builder == null) {
result.ok(null);
return;
}
if (! _lifecycle.toInit()) {
result.ok(get());
return;
}
_strategy.startOnInit(this, result);
} | java | public void startOnInit(Result<I> result)
{
DeployFactory2<I> builder = builder();
if (builder == null) {
result.ok(null);
return;
}
if (! _lifecycle.toInit()) {
result.ok(get());
return;
}
_strategy.startOnInit(this, result);
} | [
"public",
"void",
"startOnInit",
"(",
"Result",
"<",
"I",
">",
"result",
")",
"{",
"DeployFactory2",
"<",
"I",
">",
"builder",
"=",
"builder",
"(",
")",
";",
"if",
"(",
"builder",
"==",
"null",
")",
"{",
"result",
".",
"ok",
"(",
"null",
")",
";",
... | Starts the entry on initialization | [
"Starts",
"the",
"entry",
"on",
"initialization"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/deploy2/DeployService2Impl.java#L196-L212 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/deploy2/DeployService2Impl.java | DeployService2Impl.shutdown | public final void shutdown(ShutdownModeAmp mode,
Result<Boolean> result)
{
_strategy.shutdown(this, mode, result);
} | java | public final void shutdown(ShutdownModeAmp mode,
Result<Boolean> result)
{
_strategy.shutdown(this, mode, result);
} | [
"public",
"final",
"void",
"shutdown",
"(",
"ShutdownModeAmp",
"mode",
",",
"Result",
"<",
"Boolean",
">",
"result",
")",
"{",
"_strategy",
".",
"shutdown",
"(",
"this",
",",
"mode",
",",
"result",
")",
";",
"}"
] | Stops the controller from an admin command. | [
"Stops",
"the",
"controller",
"from",
"an",
"admin",
"command",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/deploy2/DeployService2Impl.java#L225-L229 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/deploy2/DeployService2Impl.java | DeployService2Impl.request | public final void request(Result<I> result)
{
I instance = _instance;
if (instance != null && _lifecycle.isActive() && ! isModified()) {
result.ok(instance);
}
else if (_lifecycle.isDestroyed()) {
result.ok(null);
}
else {
_strategy.request(this, result);
}
} | java | public final void request(Result<I> result)
{
I instance = _instance;
if (instance != null && _lifecycle.isActive() && ! isModified()) {
result.ok(instance);
}
else if (_lifecycle.isDestroyed()) {
result.ok(null);
}
else {
_strategy.request(this, result);
}
} | [
"public",
"final",
"void",
"request",
"(",
"Result",
"<",
"I",
">",
"result",
")",
"{",
"I",
"instance",
"=",
"_instance",
";",
"if",
"(",
"instance",
"!=",
"null",
"&&",
"_lifecycle",
".",
"isActive",
"(",
")",
"&&",
"!",
"isModified",
"(",
")",
")"... | Returns the instance for a top-level request
@return the request object or null for none. | [
"Returns",
"the",
"instance",
"for",
"a",
"top",
"-",
"level",
"request"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/deploy2/DeployService2Impl.java#L243-L256 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/deploy2/DeployService2Impl.java | DeployService2Impl.startImpl | public void startImpl(Result<I> result)
{
DeployFactory2<I> builder = builder();
if (builder == null) {
result.ok(null);
return;
}
if (! _lifecycle.toStarting()) {
result.ok(_instance);
return;
}
I deployInstance = null;
boolean isActive = false;
... | java | public void startImpl(Result<I> result)
{
DeployFactory2<I> builder = builder();
if (builder == null) {
result.ok(null);
return;
}
if (! _lifecycle.toStarting()) {
result.ok(_instance);
return;
}
I deployInstance = null;
boolean isActive = false;
... | [
"public",
"void",
"startImpl",
"(",
"Result",
"<",
"I",
">",
"result",
")",
"{",
"DeployFactory2",
"<",
"I",
">",
"builder",
"=",
"builder",
"(",
")",
";",
"if",
"(",
"builder",
"==",
"null",
")",
"{",
"result",
".",
"ok",
"(",
"null",
")",
";",
... | Starts the entry. | [
"Starts",
"the",
"entry",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/deploy2/DeployService2Impl.java#L265-L310 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/ColumnBlob.java | ColumnBlob.validate | @Override
public void validate(byte[] blockBuffer, int rowOffset, int rowHead, int blobTail)
{
int offset = rowOffset + offset();
int blobLen = BitsUtil.readInt16(blockBuffer, offset + 2);
int blobOffset = BitsUtil.readInt16(blockBuffer, offset);
if (blobLen == 0) {
return;
}
... | java | @Override
public void validate(byte[] blockBuffer, int rowOffset, int rowHead, int blobTail)
{
int offset = rowOffset + offset();
int blobLen = BitsUtil.readInt16(blockBuffer, offset + 2);
int blobOffset = BitsUtil.readInt16(blockBuffer, offset);
if (blobLen == 0) {
return;
}
... | [
"@",
"Override",
"public",
"void",
"validate",
"(",
"byte",
"[",
"]",
"blockBuffer",
",",
"int",
"rowOffset",
",",
"int",
"rowHead",
",",
"int",
"blobTail",
")",
"{",
"int",
"offset",
"=",
"rowOffset",
"+",
"offset",
"(",
")",
";",
"int",
"blobLen",
"=... | Validates the column, checking for corruption. | [
"Validates",
"the",
"column",
"checking",
"for",
"corruption",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/ColumnBlob.java#L575-L606 | train |
SeaCloudsEU/SeaCloudsPlatform | dashboard/src/main/java/eu/seaclouds/platform/dashboard/proxy/PlannerProxy.java | PlannerProxy.getMonitoringRulesByTemplateId | public MonitoringRules getMonitoringRulesByTemplateId(String monitoringRuleTemplateId) {
return getJerseyClient().target(getEndpoint() + "/planner/monitoringrules/" + monitoringRuleTemplateId).request()
.buildGet().invoke().readEntity(MonitoringRules.class);
} | java | public MonitoringRules getMonitoringRulesByTemplateId(String monitoringRuleTemplateId) {
return getJerseyClient().target(getEndpoint() + "/planner/monitoringrules/" + monitoringRuleTemplateId).request()
.buildGet().invoke().readEntity(MonitoringRules.class);
} | [
"public",
"MonitoringRules",
"getMonitoringRulesByTemplateId",
"(",
"String",
"monitoringRuleTemplateId",
")",
"{",
"return",
"getJerseyClient",
"(",
")",
".",
"target",
"(",
"getEndpoint",
"(",
")",
"+",
"\"/planner/monitoringrules/\"",
"+",
"monitoringRuleTemplateId",
"... | Creates proxied HTTP GET request to SeaClouds Planner which returns the monitoring rules according to the template id
@param monitoringRuleTemplateId Monitoring Rules template id
@return MonitoringRules ready to be installed in Tower4Clouds | [
"Creates",
"proxied",
"HTTP",
"GET",
"request",
"to",
"SeaClouds",
"Planner",
"which",
"returns",
"the",
"monitoring",
"rules",
"according",
"to",
"the",
"template",
"id"
] | b199fe6de2c63b808cb248d3aca947d802375df8 | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/dashboard/src/main/java/eu/seaclouds/platform/dashboard/proxy/PlannerProxy.java#L34-L37 | train |
SeaCloudsEU/SeaCloudsPlatform | dashboard/src/main/java/eu/seaclouds/platform/dashboard/proxy/PlannerProxy.java | PlannerProxy.getAdps | public String getAdps(String aam) {
Entity content = Entity.entity(aam, MediaType.TEXT_PLAIN);
Invocation invocation = getJerseyClient().target(getEndpoint() + "/planner/plan").request().buildPost(content);
return invocation.invoke().readEntity(String.class);
} | java | public String getAdps(String aam) {
Entity content = Entity.entity(aam, MediaType.TEXT_PLAIN);
Invocation invocation = getJerseyClient().target(getEndpoint() + "/planner/plan").request().buildPost(content);
return invocation.invoke().readEntity(String.class);
} | [
"public",
"String",
"getAdps",
"(",
"String",
"aam",
")",
"{",
"Entity",
"content",
"=",
"Entity",
".",
"entity",
"(",
"aam",
",",
"MediaType",
".",
"TEXT_PLAIN",
")",
";",
"Invocation",
"invocation",
"=",
"getJerseyClient",
"(",
")",
".",
"target",
"(",
... | Creates proxied HTTP POST request to SeaClouds Planner which returns a list TOSCA compliant SeaClouds ADP in JSON format
@param aam file compliant with SeaClouds AAM definition
@return String representing a List of ADP files compliant with SeaClouds ADP definition | [
"Creates",
"proxied",
"HTTP",
"POST",
"request",
"to",
"SeaClouds",
"Planner",
"which",
"returns",
"a",
"list",
"TOSCA",
"compliant",
"SeaClouds",
"ADP",
"in",
"JSON",
"format"
] | b199fe6de2c63b808cb248d3aca947d802375df8 | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/dashboard/src/main/java/eu/seaclouds/platform/dashboard/proxy/PlannerProxy.java#L45-L49 | train |
SeaCloudsEU/SeaCloudsPlatform | dashboard/src/main/java/eu/seaclouds/platform/dashboard/proxy/PlannerProxy.java | PlannerProxy.getDam | public String getDam(String adp) {
Entity content = Entity.entity(adp, MediaType.TEXT_PLAIN);
Invocation invocation = getJerseyClient().target(getEndpoint() + "/planner/damgen").request().buildPost(content);
return invocation.invoke().readEntity(String.class);
} | java | public String getDam(String adp) {
Entity content = Entity.entity(adp, MediaType.TEXT_PLAIN);
Invocation invocation = getJerseyClient().target(getEndpoint() + "/planner/damgen").request().buildPost(content);
return invocation.invoke().readEntity(String.class);
} | [
"public",
"String",
"getDam",
"(",
"String",
"adp",
")",
"{",
"Entity",
"content",
"=",
"Entity",
".",
"entity",
"(",
"adp",
",",
"MediaType",
".",
"TEXT_PLAIN",
")",
";",
"Invocation",
"invocation",
"=",
"getJerseyClient",
"(",
")",
".",
"target",
"(",
... | Creates proxied HTTP POST request to SeaClouds Planner which returns a SeaClouds TOSCA DAM file
@param adp file compliant with SeaClouds ADP definition
@return TOSCA DAM compliant with SeaClouds TOSCA DAM definition | [
"Creates",
"proxied",
"HTTP",
"POST",
"request",
"to",
"SeaClouds",
"Planner",
"which",
"returns",
"a",
"SeaClouds",
"TOSCA",
"DAM",
"file"
] | b199fe6de2c63b808cb248d3aca947d802375df8 | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/dashboard/src/main/java/eu/seaclouds/platform/dashboard/proxy/PlannerProxy.java#L57-L61 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/reflect/ReflectUtil.java | ReflectUtil.isMatch | public static boolean isMatch(Class<?> []paramA, Class<?> []paramB)
{
if (paramA.length != paramB.length)
return false;
for (int i = paramA.length - 1; i >= 0; i--) {
if (! paramA[i].equals(paramB[i]))
return false;
}
return true;
} | java | public static boolean isMatch(Class<?> []paramA, Class<?> []paramB)
{
if (paramA.length != paramB.length)
return false;
for (int i = paramA.length - 1; i >= 0; i--) {
if (! paramA[i].equals(paramB[i]))
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isMatch",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"paramA",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"paramB",
")",
"{",
"if",
"(",
"paramA",
".",
"length",
"!=",
"paramB",
".",
"length",
")",
"return",
"false",
";",
... | Tests if parameters match a method's parameter types. | [
"Tests",
"if",
"parameters",
"match",
"a",
"method",
"s",
"parameter",
"types",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/reflect/ReflectUtil.java#L170-L181 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/pod/NodePod.java | NodePod.isServerPrimary | @Override
public boolean isServerPrimary(ServerBartender server)
{
for (int i = 0; i < Math.min(1, _owners.length); i++) {
ServerBartender serverBar = server(i);
if (serverBar == null) {
continue;
}
else if (serverBar.isSameServer(server)) {
return true;
}
... | java | @Override
public boolean isServerPrimary(ServerBartender server)
{
for (int i = 0; i < Math.min(1, _owners.length); i++) {
ServerBartender serverBar = server(i);
if (serverBar == null) {
continue;
}
else if (serverBar.isSameServer(server)) {
return true;
}
... | [
"@",
"Override",
"public",
"boolean",
"isServerPrimary",
"(",
"ServerBartender",
"server",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"Math",
".",
"min",
"(",
"1",
",",
"_owners",
".",
"length",
")",
";",
"i",
"++",
")",
"{",
"Serve... | Test if the server is the primary for the node. | [
"Test",
"if",
"the",
"server",
"is",
"the",
"primary",
"for",
"the",
"node",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/NodePod.java#L114-L129 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/pod/NodePod.java | NodePod.isServerOwner | @Override
public boolean isServerOwner(ServerBartender server)
{
for (int i = 0; i < _owners.length; i++) {
ServerBartender serverBar = server(i);
if (serverBar == null) {
continue;
}
else if (serverBar.isSameServer(server)) {
return server.isUp();
}
else if ... | java | @Override
public boolean isServerOwner(ServerBartender server)
{
for (int i = 0; i < _owners.length; i++) {
ServerBartender serverBar = server(i);
if (serverBar == null) {
continue;
}
else if (serverBar.isSameServer(server)) {
return server.isUp();
}
else if ... | [
"@",
"Override",
"public",
"boolean",
"isServerOwner",
"(",
"ServerBartender",
"server",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"_owners",
".",
"length",
";",
"i",
"++",
")",
"{",
"ServerBartender",
"serverBar",
"=",
"server",
"(",
... | Test if the server is the current owner of the node. The owner is the
first live server in the backup list.
@param server the server to test
@return true if the server is a node copy and also the first active server. | [
"Test",
"if",
"the",
"server",
"is",
"the",
"current",
"owner",
"of",
"the",
"node",
".",
"The",
"owner",
"is",
"the",
"first",
"live",
"server",
"in",
"the",
"backup",
"list",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/NodePod.java#L139-L157 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/pod/NodePod.java | NodePod.isServerCopy | @Override
public boolean isServerCopy(ServerBartender server)
{
for (int i = 0; i < _owners.length; i++) {
ServerBartender serverBar = server(i);
if (serverBar != null && serverBar.isSameServer(server)) {
return true;
}
}
return false;
} | java | @Override
public boolean isServerCopy(ServerBartender server)
{
for (int i = 0; i < _owners.length; i++) {
ServerBartender serverBar = server(i);
if (serverBar != null && serverBar.isSameServer(server)) {
return true;
}
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"isServerCopy",
"(",
"ServerBartender",
"server",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"_owners",
".",
"length",
";",
"i",
"++",
")",
"{",
"ServerBartender",
"serverBar",
"=",
"server",
"(",
"... | Test if the server is the one of the node copies.
@param server the server to test
@return true if the server is a node copy | [
"Test",
"if",
"the",
"server",
"is",
"the",
"one",
"of",
"the",
"node",
"copies",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/NodePod.java#L166-L178 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/pod/NodePod.java | NodePod.owner | public ServerBartender owner()
{
for (int i = 0; i < _owners.length; i++) {
ServerBartender serverBar = server(i);
if (serverBar != null && serverBar.isUp()) {
return serverBar;
}
}
return null;
} | java | public ServerBartender owner()
{
for (int i = 0; i < _owners.length; i++) {
ServerBartender serverBar = server(i);
if (serverBar != null && serverBar.isUp()) {
return serverBar;
}
}
return null;
} | [
"public",
"ServerBartender",
"owner",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"_owners",
".",
"length",
";",
"i",
"++",
")",
"{",
"ServerBartender",
"serverBar",
"=",
"server",
"(",
"i",
")",
";",
"if",
"(",
"serverBar",
"!=... | Return the current server owner. | [
"Return",
"the",
"current",
"server",
"owner",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/NodePod.java#L183-L194 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/heartbeat/BartenderBuilderHeartbeat.java | BartenderBuilderHeartbeat.pod | @Override
public BartenderBuilderPod pod(String id, String clusterId)
{
Objects.requireNonNull(id);
Objects.requireNonNull(clusterId);
ClusterHeartbeat cluster = createCluster(clusterId);
return new PodBuilderConfig(id, cluster, this);
} | java | @Override
public BartenderBuilderPod pod(String id, String clusterId)
{
Objects.requireNonNull(id);
Objects.requireNonNull(clusterId);
ClusterHeartbeat cluster = createCluster(clusterId);
return new PodBuilderConfig(id, cluster, this);
} | [
"@",
"Override",
"public",
"BartenderBuilderPod",
"pod",
"(",
"String",
"id",
",",
"String",
"clusterId",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"id",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"clusterId",
")",
";",
"ClusterHeartbeat",
"cluste... | Create a configured pod. | [
"Create",
"a",
"configured",
"pod",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/BartenderBuilderHeartbeat.java#L237-L246 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/heartbeat/BartenderBuilderHeartbeat.java | BartenderBuilderHeartbeat.initLocalPod | private UpdatePod initLocalPod()
{
ServerBartender serverSelf = _bartender.serverSelf();
ServicesAmp rampManager = AmpSystem.currentManager();
UpdatePodBuilder podBuilder = new UpdatePodBuilder();
podBuilder.name("local");
podBuilder.cluster(_bartender.serverSelf().getCluster());
... | java | private UpdatePod initLocalPod()
{
ServerBartender serverSelf = _bartender.serverSelf();
ServicesAmp rampManager = AmpSystem.currentManager();
UpdatePodBuilder podBuilder = new UpdatePodBuilder();
podBuilder.name("local");
podBuilder.cluster(_bartender.serverSelf().getCluster());
... | [
"private",
"UpdatePod",
"initLocalPod",
"(",
")",
"{",
"ServerBartender",
"serverSelf",
"=",
"_bartender",
".",
"serverSelf",
"(",
")",
";",
"ServicesAmp",
"rampManager",
"=",
"AmpSystem",
".",
"currentManager",
"(",
")",
";",
"UpdatePodBuilder",
"podBuilder",
"="... | The local pod refers to the server itself. | [
"The",
"local",
"pod",
"refers",
"to",
"the",
"server",
"itself",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/BartenderBuilderHeartbeat.java#L681-L709 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java | JavaCompilerUtil.create | public static JavaCompilerUtil create(ClassLoader loader)
{
JavacConfig config = JavacConfig.getLocalConfig();
String javac = config.getCompiler();
JavaCompilerUtil javaCompiler = new JavaCompilerUtil();
if (loader == null) {
loader = Thread.currentThread().getContextClassLoader();
}
... | java | public static JavaCompilerUtil create(ClassLoader loader)
{
JavacConfig config = JavacConfig.getLocalConfig();
String javac = config.getCompiler();
JavaCompilerUtil javaCompiler = new JavaCompilerUtil();
if (loader == null) {
loader = Thread.currentThread().getContextClassLoader();
}
... | [
"public",
"static",
"JavaCompilerUtil",
"create",
"(",
"ClassLoader",
"loader",
")",
"{",
"JavacConfig",
"config",
"=",
"JavacConfig",
".",
"getLocalConfig",
"(",
")",
";",
"String",
"javac",
"=",
"config",
".",
"getCompiler",
"(",
")",
";",
"JavaCompilerUtil",
... | Creates a new compiler.
@param loader the parent class loader for the compiler. | [
"Creates",
"a",
"new",
"compiler",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java#L119-L140 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java | JavaCompilerUtil.getClassPath | public String getClassPath()
{
String rawClassPath = buildClassPath();
if (true)
return rawClassPath;
char sep = CauchoUtil.getPathSeparatorChar();
String []splitClassPath = rawClassPath.split("[" + sep + "]");
String javaHome = System.getProperty("java.home");
PathImpl pwd = VfsOld.... | java | public String getClassPath()
{
String rawClassPath = buildClassPath();
if (true)
return rawClassPath;
char sep = CauchoUtil.getPathSeparatorChar();
String []splitClassPath = rawClassPath.split("[" + sep + "]");
String javaHome = System.getProperty("java.home");
PathImpl pwd = VfsOld.... | [
"public",
"String",
"getClassPath",
"(",
")",
"{",
"String",
"rawClassPath",
"=",
"buildClassPath",
"(",
")",
";",
"if",
"(",
"true",
")",
"return",
"rawClassPath",
";",
"char",
"sep",
"=",
"CauchoUtil",
".",
"getPathSeparatorChar",
"(",
")",
";",
"String",
... | Returns the classpath. | [
"Returns",
"the",
"classpath",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java#L283-L314 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java | JavaCompilerUtil.buildClassPath | private String buildClassPath()
{
String classPath = null;//_classPath;
if (classPath != null) {
return classPath;
}
if (classPath == null && _loader instanceof DynamicClassLoader) {
classPath = ((DynamicClassLoader) _loader).getClassPath();
}
else { // if (true || _loader instan... | java | private String buildClassPath()
{
String classPath = null;//_classPath;
if (classPath != null) {
return classPath;
}
if (classPath == null && _loader instanceof DynamicClassLoader) {
classPath = ((DynamicClassLoader) _loader).getClassPath();
}
else { // if (true || _loader instan... | [
"private",
"String",
"buildClassPath",
"(",
")",
"{",
"String",
"classPath",
"=",
"null",
";",
"//_classPath;",
"if",
"(",
"classPath",
"!=",
"null",
")",
"{",
"return",
"classPath",
";",
"}",
"if",
"(",
"classPath",
"==",
"null",
"&&",
"_loader",
"instanc... | Returns the classpath for the compiler. | [
"Returns",
"the",
"classpath",
"for",
"the",
"compiler",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java#L320-L357 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java | JavaCompilerUtil.setArgs | public void setArgs(String argString)
{
try {
if (argString != null) {
String []args = Pattern.compile("[\\s,]+").split(argString);
_args = new ArrayList<String>();
for (int i = 0; i < args.length; i++) {
if (! args[i].equals(""))
_args.add(args[i]);
}... | java | public void setArgs(String argString)
{
try {
if (argString != null) {
String []args = Pattern.compile("[\\s,]+").split(argString);
_args = new ArrayList<String>();
for (int i = 0; i < args.length; i++) {
if (! args[i].equals(""))
_args.add(args[i]);
}... | [
"public",
"void",
"setArgs",
"(",
"String",
"argString",
")",
"{",
"try",
"{",
"if",
"(",
"argString",
"!=",
"null",
")",
"{",
"String",
"[",
"]",
"args",
"=",
"Pattern",
".",
"compile",
"(",
"\"[\\\\s,]+\"",
")",
".",
"split",
"(",
"argString",
")",
... | Sets any additional arguments for the compiler. | [
"Sets",
"any",
"additional",
"arguments",
"for",
"the",
"compiler",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java#L397-L413 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java | JavaCompilerUtil.setEncoding | public void setEncoding(String encoding)
{
_charEncoding = encoding;
String javaEncoding = Encoding.getJavaName(encoding);
if ("ISO8859_1".equals(javaEncoding))
_charEncoding = null;
} | java | public void setEncoding(String encoding)
{
_charEncoding = encoding;
String javaEncoding = Encoding.getJavaName(encoding);
if ("ISO8859_1".equals(javaEncoding))
_charEncoding = null;
} | [
"public",
"void",
"setEncoding",
"(",
"String",
"encoding",
")",
"{",
"_charEncoding",
"=",
"encoding",
";",
"String",
"javaEncoding",
"=",
"Encoding",
".",
"getJavaName",
"(",
"encoding",
")",
";",
"if",
"(",
"\"ISO8859_1\"",
".",
"equals",
"(",
"javaEncoding... | Sets the Java encoding for the compiler. | [
"Sets",
"the",
"Java",
"encoding",
"for",
"the",
"compiler",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java#L426-L434 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java | JavaCompilerUtil.mangleName | public static String mangleName(String name)
{
boolean toLower = CauchoUtil.isCaseInsensitive();
CharBuffer cb = new CharBuffer();
cb.append("_");
for (int i = 0; i < name.length(); i++) {
char ch = name.charAt(i);
if (ch == '/' || ch == CauchoUtil.getPathSeparatorChar()) {
if (... | java | public static String mangleName(String name)
{
boolean toLower = CauchoUtil.isCaseInsensitive();
CharBuffer cb = new CharBuffer();
cb.append("_");
for (int i = 0; i < name.length(); i++) {
char ch = name.charAt(i);
if (ch == '/' || ch == CauchoUtil.getPathSeparatorChar()) {
if (... | [
"public",
"static",
"String",
"mangleName",
"(",
"String",
"name",
")",
"{",
"boolean",
"toLower",
"=",
"CauchoUtil",
".",
"isCaseInsensitive",
"(",
")",
";",
"CharBuffer",
"cb",
"=",
"new",
"CharBuffer",
"(",
")",
";",
"cb",
".",
"append",
"(",
"\"_\"",
... | Mangles the path into a valid Java class name. | [
"Mangles",
"the",
"path",
"into",
"a",
"valid",
"Java",
"class",
"name",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java#L487-L521 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java | JavaCompilerUtil.compileBatch | public void compileBatch(String []files)
throws IOException, ClassNotFoundException
{
if (_compileParent) {
try {
if (_loader instanceof Make)
((Make) _loader).make();
} catch (Exception e) {
throw new IOException(e);
}
}
if (files.length == 0)
return... | java | public void compileBatch(String []files)
throws IOException, ClassNotFoundException
{
if (_compileParent) {
try {
if (_loader instanceof Make)
((Make) _loader).make();
} catch (Exception e) {
throw new IOException(e);
}
}
if (files.length == 0)
return... | [
"public",
"void",
"compileBatch",
"(",
"String",
"[",
"]",
"files",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"if",
"(",
"_compileParent",
")",
"{",
"try",
"{",
"if",
"(",
"_loader",
"instanceof",
"Make",
")",
"(",
"(",
"Make",
")",... | Compiles a batch list of classes.
@return compiled class | [
"Compiles",
"a",
"batch",
"list",
"of",
"classes",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/javac/JavaCompilerUtil.java#L634-L698 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/StreamPrintWriter.java | StreamPrintWriter.write | final public void write(char []buf)
{
try {
_out.print(buf, 0, buf.length);
} catch (IOException e) {
log.log(Level.FINE, e.toString(), e);
}
} | java | final public void write(char []buf)
{
try {
_out.print(buf, 0, buf.length);
} catch (IOException e) {
log.log(Level.FINE, e.toString(), e);
}
} | [
"final",
"public",
"void",
"write",
"(",
"char",
"[",
"]",
"buf",
")",
"{",
"try",
"{",
"_out",
".",
"print",
"(",
"buf",
",",
"0",
",",
"buf",
".",
"length",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"log",
".",
"log",
"(",
... | Writes a character buffer. | [
"Writes",
"a",
"character",
"buffer",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/StreamPrintWriter.java#L91-L98 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/web/server/WaitForExitService.java | WaitForExitService.waitForExit | void waitForExit()
{
Runtime runtime = Runtime.getRuntime();
ShutdownSystem shutdown = _resinSystem.getSystem(ShutdownSystem.class);
if (shutdown == null) {
throw new IllegalStateException(L.l("'{0}' requires an active {1}",
this,
... | java | void waitForExit()
{
Runtime runtime = Runtime.getRuntime();
ShutdownSystem shutdown = _resinSystem.getSystem(ShutdownSystem.class);
if (shutdown == null) {
throw new IllegalStateException(L.l("'{0}' requires an active {1}",
this,
... | [
"void",
"waitForExit",
"(",
")",
"{",
"Runtime",
"runtime",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
";",
"ShutdownSystem",
"shutdown",
"=",
"_resinSystem",
".",
"getSystem",
"(",
"ShutdownSystem",
".",
"class",
")",
";",
"if",
"(",
"shutdown",
"==",
"... | Thread to wait until Resin should be stopped. | [
"Thread",
"to",
"wait",
"until",
"Resin",
"should",
"be",
"stopped",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/web/server/WaitForExitService.java#L94-L143 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/pod/ServiceRefPod.java | ServiceRefPod.getLocalService | public ServiceRefAmp getLocalService()
{
ServiceRefAmp serviceRefRoot = _podRoot.getLocalService();
//ServiceRefAmp serviceRefRoot = _podRoot.getClientService();
if (serviceRefRoot == null) {
return null;
}
ServiceRefActive serviceRefLocal = _serviceRefLocal;
if (serviceRe... | java | public ServiceRefAmp getLocalService()
{
ServiceRefAmp serviceRefRoot = _podRoot.getLocalService();
//ServiceRefAmp serviceRefRoot = _podRoot.getClientService();
if (serviceRefRoot == null) {
return null;
}
ServiceRefActive serviceRefLocal = _serviceRefLocal;
if (serviceRe... | [
"public",
"ServiceRefAmp",
"getLocalService",
"(",
")",
"{",
"ServiceRefAmp",
"serviceRefRoot",
"=",
"_podRoot",
".",
"getLocalService",
"(",
")",
";",
"//ServiceRefAmp serviceRefRoot = _podRoot.getClientService();",
"if",
"(",
"serviceRefRoot",
"==",
"null",
")",
"{",
... | Returns the active service for this pod and path's hash.
The hash of the path selects the pod's node. The active server is the
first server in the node's server list that is up. | [
"Returns",
"the",
"active",
"service",
"for",
"this",
"pod",
"and",
"path",
"s",
"hash",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/ServiceRefPod.java#L239-L265 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/HttpPath.java | HttpPath.lookupImpl | @Override
public PathImpl lookupImpl(String userPath,
Map<String,Object> newAttributes,
boolean isAllowRoot)
{
String newPath;
if (userPath == null)
return _root.fsWalk(getPath(), newAttributes, "/");
int length = userPath.length();
int colo... | java | @Override
public PathImpl lookupImpl(String userPath,
Map<String,Object> newAttributes,
boolean isAllowRoot)
{
String newPath;
if (userPath == null)
return _root.fsWalk(getPath(), newAttributes, "/");
int length = userPath.length();
int colo... | [
"@",
"Override",
"public",
"PathImpl",
"lookupImpl",
"(",
"String",
"userPath",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"newAttributes",
",",
"boolean",
"isAllowRoot",
")",
"{",
"String",
"newPath",
";",
"if",
"(",
"userPath",
"==",
"null",
")",
"re... | Overrides the default lookup to parse the host and port
before parsing the path.
@param userPath the path passed in by the user
@param newAttributes attributes passed by the user
@return the final path. | [
"Overrides",
"the",
"default",
"lookup",
"to",
"parse",
"the",
"host",
"and",
"port",
"before",
"parsing",
"the",
"path",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/HttpPath.java#L113-L165 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/HttpPath.java | HttpPath.schemeWalk | @Override
public PathImpl schemeWalk(String userPath,
Map<String,Object> attributes,
String uri,
int offset)
{
int length = uri.length();
if (length < 2 + offset
|| uri.charAt(offset) != '/'
|| uri.charAt(offset + 1)... | java | @Override
public PathImpl schemeWalk(String userPath,
Map<String,Object> attributes,
String uri,
int offset)
{
int length = uri.length();
if (length < 2 + offset
|| uri.charAt(offset) != '/'
|| uri.charAt(offset + 1)... | [
"@",
"Override",
"public",
"PathImpl",
"schemeWalk",
"(",
"String",
"userPath",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
",",
"String",
"uri",
",",
"int",
"offset",
")",
"{",
"int",
"length",
"=",
"uri",
".",
"length",
"(",
")",
";"... | Walk down the path starting from the portion immediately following
the scheme. i.e. schemeWalk is responsible for parsing the host and
port from the URL.
@param userPath the user's passed in path
@param attributes the attributes for the new path
@param uri the normalized full uri
@param offset offset into the uri to ... | [
"Walk",
"down",
"the",
"path",
"starting",
"from",
"the",
"portion",
"immediately",
"following",
"the",
"scheme",
".",
"i",
".",
"e",
".",
"schemeWalk",
"is",
"responsible",
"for",
"parsing",
"the",
"host",
"and",
"port",
"from",
"the",
"URL",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/HttpPath.java#L180-L228 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/HttpPath.java | HttpPath.fsWalk | public PathImpl fsWalk(String userPath,
Map<String,Object> attributes,
String uri)
{
String path;
String query = null;
int queryIndex = uri.indexOf('?');
if (queryIndex >= 0) {
path = uri.substring(0, queryIndex);
query = uri.substring(queryIndex +... | java | public PathImpl fsWalk(String userPath,
Map<String,Object> attributes,
String uri)
{
String path;
String query = null;
int queryIndex = uri.indexOf('?');
if (queryIndex >= 0) {
path = uri.substring(0, queryIndex);
query = uri.substring(queryIndex +... | [
"public",
"PathImpl",
"fsWalk",
"(",
"String",
"userPath",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
",",
"String",
"uri",
")",
"{",
"String",
"path",
";",
"String",
"query",
"=",
"null",
";",
"int",
"queryIndex",
"=",
"uri",
".",
"i... | Scans the path portion of the URI, i.e. everything after the
host and port.
@param userPath the user's supplied path
@param attributes the attributes for the new path
@param uri the full uri for the new path.
@return the found path. | [
"Scans",
"the",
"path",
"portion",
"of",
"the",
"URI",
"i",
".",
"e",
".",
"everything",
"after",
"the",
"host",
"and",
"port",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/HttpPath.java#L240-L257 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/HttpPath.java | HttpPath.getURL | public String getURL()
{
int port = getPort();
return (getScheme() + "://" + getHost() +
(port == 80 ? "" : ":" + getPort()) +
getPath() +
(_query == null ? "" : "?" + _query));
} | java | public String getURL()
{
int port = getPort();
return (getScheme() + "://" + getHost() +
(port == 80 ? "" : ":" + getPort()) +
getPath() +
(_query == null ? "" : "?" + _query));
} | [
"public",
"String",
"getURL",
"(",
")",
"{",
"int",
"port",
"=",
"getPort",
"(",
")",
";",
"return",
"(",
"getScheme",
"(",
")",
"+",
"\"://\"",
"+",
"getHost",
"(",
")",
"+",
"(",
"port",
"==",
"80",
"?",
"\"\"",
":",
"\":\"",
"+",
"getPort",
"(... | Returns a full URL for the path. | [
"Returns",
"a",
"full",
"URL",
"for",
"the",
"path",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/HttpPath.java#L283-L291 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/util/HashMapImpl.java | HashMapImpl.putImpl | private V putImpl(K key, V value)
{
V item = null;
int hash = key.hashCode() & _mask;
int count = _values.length;
for (; count > 0; count--) {
item = _values[hash];
// No matching item, so create one
if (item == null) {
_keys[hash] = key;
_values[hash] = value;
... | java | private V putImpl(K key, V value)
{
V item = null;
int hash = key.hashCode() & _mask;
int count = _values.length;
for (; count > 0; count--) {
item = _values[hash];
// No matching item, so create one
if (item == null) {
_keys[hash] = key;
_values[hash] = value;
... | [
"private",
"V",
"putImpl",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"V",
"item",
"=",
"null",
";",
"int",
"hash",
"=",
"key",
".",
"hashCode",
"(",
")",
"&",
"_mask",
";",
"int",
"count",
"=",
"_values",
".",
"length",
";",
"for",
"(",
";"... | Implementation of the put. | [
"Implementation",
"of",
"the",
"put",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/HashMapImpl.java#L195-L225 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/FilePath.java | FilePath.getURL | public String getURL()
{
if (! isWindows())
return escapeURL("file:" + getFullPath());
String path = getFullPath();
int length = path.length();
CharBuffer cb = new CharBuffer();
// #2725, server/1495
cb.append("file:");
char ch;
int offset = 0;
// For windows, convert /c: ... | java | public String getURL()
{
if (! isWindows())
return escapeURL("file:" + getFullPath());
String path = getFullPath();
int length = path.length();
CharBuffer cb = new CharBuffer();
// #2725, server/1495
cb.append("file:");
char ch;
int offset = 0;
// For windows, convert /c: ... | [
"public",
"String",
"getURL",
"(",
")",
"{",
"if",
"(",
"!",
"isWindows",
"(",
")",
")",
"return",
"escapeURL",
"(",
"\"file:\"",
"+",
"getFullPath",
"(",
")",
")",
";",
"String",
"path",
"=",
"getFullPath",
"(",
")",
";",
"int",
"length",
"=",
"path... | Returns the full url for the given path. | [
"Returns",
"the",
"full",
"url",
"for",
"the",
"given",
"path",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/FilePath.java#L251-L295 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/FilePath.java | FilePath.getNativePath | @Override
public String getNativePath()
{
if (! isWindows()) {
return getFullPath();
}
String path = getFullPath();
int length = path.length();
CharBuffer cb = new CharBuffer();
char ch;
int offset = 0;
// For windows, convert /c: to c:
if (length >= 3
&& path.cha... | java | @Override
public String getNativePath()
{
if (! isWindows()) {
return getFullPath();
}
String path = getFullPath();
int length = path.length();
CharBuffer cb = new CharBuffer();
char ch;
int offset = 0;
// For windows, convert /c: to c:
if (length >= 3
&& path.cha... | [
"@",
"Override",
"public",
"String",
"getNativePath",
"(",
")",
"{",
"if",
"(",
"!",
"isWindows",
"(",
")",
")",
"{",
"return",
"getFullPath",
"(",
")",
";",
"}",
"String",
"path",
"=",
"getFullPath",
"(",
")",
";",
"int",
"length",
"=",
"path",
".",... | Returns the native path. | [
"Returns",
"the",
"native",
"path",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/FilePath.java#L300-L340 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/FilePath.java | FilePath.list | public String []list() throws IOException
{
try {
String []list = getFile().list();
if (list != null)
return list;
} catch (AccessControlException e) {
log.finer(e.toString());
}
return new String[0];
} | java | public String []list() throws IOException
{
try {
String []list = getFile().list();
if (list != null)
return list;
} catch (AccessControlException e) {
log.finer(e.toString());
}
return new String[0];
} | [
"public",
"String",
"[",
"]",
"list",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"String",
"[",
"]",
"list",
"=",
"getFile",
"(",
")",
".",
"list",
"(",
")",
";",
"if",
"(",
"list",
"!=",
"null",
")",
"return",
"list",
";",
"}",
"catch",... | Returns a list of files in the directory. | [
"Returns",
"a",
"list",
"of",
"files",
"in",
"the",
"directory",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/FilePath.java#L484-L496 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/FilePath.java | FilePath.openReadImpl | public StreamImpl openReadImpl() throws IOException
{
if (_isWindows && isAux())
throw new FileNotFoundException(_file.toString());
/* XXX: only for Solaris (?)
if (isDirectory())
throw new IOException("is directory");
*/
return new FileReadStream(new FileInputStream(getFile()), this... | java | public StreamImpl openReadImpl() throws IOException
{
if (_isWindows && isAux())
throw new FileNotFoundException(_file.toString());
/* XXX: only for Solaris (?)
if (isDirectory())
throw new IOException("is directory");
*/
return new FileReadStream(new FileInputStream(getFile()), this... | [
"public",
"StreamImpl",
"openReadImpl",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_isWindows",
"&&",
"isAux",
"(",
")",
")",
"throw",
"new",
"FileNotFoundException",
"(",
"_file",
".",
"toString",
"(",
")",
")",
";",
"/* XXX: only for Solaris (?)\n ... | Returns the stream implementation for a read stream. | [
"Returns",
"the",
"stream",
"implementation",
"for",
"a",
"read",
"stream",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/FilePath.java#L583-L594 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/FilePath.java | FilePath.isAux | public boolean isAux()
{
if (! _isWindows)
return false;
File file = getFile();
String path = getFullPath().toLowerCase(Locale.ENGLISH);
int len = path.length();
int p = path.indexOf("/aux");
int ch;
if (p >= 0 && (len <= p + 4 || path.charAt(p + 4) == '.'))
return true;
... | java | public boolean isAux()
{
if (! _isWindows)
return false;
File file = getFile();
String path = getFullPath().toLowerCase(Locale.ENGLISH);
int len = path.length();
int p = path.indexOf("/aux");
int ch;
if (p >= 0 && (len <= p + 4 || path.charAt(p + 4) == '.'))
return true;
... | [
"public",
"boolean",
"isAux",
"(",
")",
"{",
"if",
"(",
"!",
"_isWindows",
")",
"return",
"false",
";",
"File",
"file",
"=",
"getFile",
"(",
")",
";",
"String",
"path",
"=",
"getFullPath",
"(",
")",
".",
"toLowerCase",
"(",
"Locale",
".",
"ENGLISH",
... | Special case for the evil windows special | [
"Special",
"case",
"for",
"the",
"evil",
"windows",
"special"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/FilePath.java#L709-L740 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/http/container/HttpContainerBase.java | HttpContainerBase.clearCache | public void clearCache()
{
// skip the clear on restart
if (_lifecycle.isStopping()) {
return;
}
if (log.isLoggable(Level.FINER)) {
log.finest("clearCache");
}
// the invocation cache must be cleared first because the old
// filter chain entries must not point to the cache's
... | java | public void clearCache()
{
// skip the clear on restart
if (_lifecycle.isStopping()) {
return;
}
if (log.isLoggable(Level.FINER)) {
log.finest("clearCache");
}
// the invocation cache must be cleared first because the old
// filter chain entries must not point to the cache's
... | [
"public",
"void",
"clearCache",
"(",
")",
"{",
"// skip the clear on restart",
"if",
"(",
"_lifecycle",
".",
"isStopping",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"log",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
")",
"{",
"log",
".... | Clears the proxy cache. | [
"Clears",
"the",
"proxy",
"cache",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/container/HttpContainerBase.java#L428-L449 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/BlobOutputStream.java | BlobOutputStream.init | public void init()
{
_offset = 0;
if (_tempBuffer == null) {
_tempBuffer = TempBuffer.create();
_buffer = _tempBuffer.buffer();
_bufferEnd = _buffer.length;
}
} | java | public void init()
{
_offset = 0;
if (_tempBuffer == null) {
_tempBuffer = TempBuffer.create();
_buffer = _tempBuffer.buffer();
_bufferEnd = _buffer.length;
}
} | [
"public",
"void",
"init",
"(",
")",
"{",
"_offset",
"=",
"0",
";",
"if",
"(",
"_tempBuffer",
"==",
"null",
")",
"{",
"_tempBuffer",
"=",
"TempBuffer",
".",
"create",
"(",
")",
";",
"_buffer",
"=",
"_tempBuffer",
".",
"buffer",
"(",
")",
";",
"_buffer... | Initialize the output stream. | [
"Initialize",
"the",
"output",
"stream",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/BlobOutputStream.java#L128-L137 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/BlobOutputStream.java | BlobOutputStream.write | @Override
public void write(byte []buffer, int offset, int length)
throws IOException
{
while (length > 0) {
if (_bufferEnd <= _offset) {
flushBlock(false);
}
int sublen = Math.min(_bufferEnd - _offset, length);
System.arraycopy(buffer, offset, _buffer, _offset, sublen);
... | java | @Override
public void write(byte []buffer, int offset, int length)
throws IOException
{
while (length > 0) {
if (_bufferEnd <= _offset) {
flushBlock(false);
}
int sublen = Math.min(_bufferEnd - _offset, length);
System.arraycopy(buffer, offset, _buffer, _offset, sublen);
... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"while",
"(",
"length",
">",
"0",
")",
"{",
"if",
"(",
"_bufferEnd",
"<=",
"_offset",
")",
"{"... | Writes a buffer. | [
"Writes",
"a",
"buffer",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/BlobOutputStream.java#L203-L221 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/BlobOutputStream.java | BlobOutputStream.close | @Override
public void close()
throws IOException
{
if (_isClosed) {
return;
}
_isClosed = true;
flushBlock(true);
_cursor.setBlob(_column.index(), this);
} | java | @Override
public void close()
throws IOException
{
if (_isClosed) {
return;
}
_isClosed = true;
flushBlock(true);
_cursor.setBlob(_column.index(), this);
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_isClosed",
")",
"{",
"return",
";",
"}",
"_isClosed",
"=",
"true",
";",
"flushBlock",
"(",
"true",
")",
";",
"_cursor",
".",
"setBlob",
"(",
"_column",
"."... | Completes the stream. | [
"Completes",
"the",
"stream",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/BlobOutputStream.java#L270-L283 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/BlobOutputStream.java | BlobOutputStream.flushBlock | private void flushBlock(boolean isClose)
throws IOException
{
if (isClose) {
if (! _isLargeBlob && _offset <= _table.getInlineBlobMax()) {
return;
}
}
_isLargeBlob = true;
if (_blobOut == null) {
_blobOut = _table.getTempStore().openWriter();
}
if (_off... | java | private void flushBlock(boolean isClose)
throws IOException
{
if (isClose) {
if (! _isLargeBlob && _offset <= _table.getInlineBlobMax()) {
return;
}
}
_isLargeBlob = true;
if (_blobOut == null) {
_blobOut = _table.getTempStore().openWriter();
}
if (_off... | [
"private",
"void",
"flushBlock",
"(",
"boolean",
"isClose",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isClose",
")",
"{",
"if",
"(",
"!",
"_isLargeBlob",
"&&",
"_offset",
"<=",
"_table",
".",
"getInlineBlobMax",
"(",
")",
")",
"{",
"return",
";",
"}... | flushes a block of the blob to the temp store if larger than
the inline size. | [
"flushes",
"a",
"block",
"of",
"the",
"blob",
"to",
"the",
"temp",
"store",
"if",
"larger",
"than",
"the",
"inline",
"size",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/BlobOutputStream.java#L289-L349 | train |
SeaCloudsEU/SeaCloudsPlatform | discoverer/src/main/java/eu/seaclouds/platform/discoverer/crawler/CloudHarmonySPECint.java | CloudHarmonySPECint.getSPECint | public static Integer getSPECint(String providerName, String instanceType) {
String key = providerName + "." + instanceType;
return SPECint.get(key);
} | java | public static Integer getSPECint(String providerName, String instanceType) {
String key = providerName + "." + instanceType;
return SPECint.get(key);
} | [
"public",
"static",
"Integer",
"getSPECint",
"(",
"String",
"providerName",
",",
"String",
"instanceType",
")",
"{",
"String",
"key",
"=",
"providerName",
"+",
"\".\"",
"+",
"instanceType",
";",
"return",
"SPECint",
".",
"get",
"(",
"key",
")",
";",
"}"
] | Gets the SPECint of the specified instance of the specified offerings provider
@param providerName the name of the offerings provider
@param instanceType istance type as specified in the CloudHarmony API
@return SPECint of the specified instance | [
"Gets",
"the",
"SPECint",
"of",
"the",
"specified",
"instance",
"of",
"the",
"specified",
"offerings",
"provider"
] | b199fe6de2c63b808cb248d3aca947d802375df8 | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/discoverer/src/main/java/eu/seaclouds/platform/discoverer/crawler/CloudHarmonySPECint.java#L79-L82 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/util/Hex.java | Hex.toHex | public static String toHex(byte []bytes, int offset, int len)
{
if (bytes == null)
return "null";
StringBuilder sb = new StringBuilder();
for (int i = 0; i < len; i++) {
int d1 = (bytes[offset + i] >> 4) & 0xf;
int d2 = (bytes[offset + i]) & 0xf;
if (d1 < 10)
sb.appe... | java | public static String toHex(byte []bytes, int offset, int len)
{
if (bytes == null)
return "null";
StringBuilder sb = new StringBuilder();
for (int i = 0; i < len; i++) {
int d1 = (bytes[offset + i] >> 4) & 0xf;
int d2 = (bytes[offset + i]) & 0xf;
if (d1 < 10)
sb.appe... | [
"public",
"static",
"String",
"toHex",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"if",
"(",
"bytes",
"==",
"null",
")",
"return",
"\"null\"",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
... | Convert bytes to hex | [
"Convert",
"bytes",
"to",
"hex"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/Hex.java#L50-L73 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/util/Hex.java | Hex.toBytes | public static byte []toBytes(String hex)
{
if (hex == null)
return null;
int len = hex.length();
byte []bytes = new byte[len / 2];
int k = 0;
for (int i = 0; i < len; i += 2) {
int digit = 0;
char ch = hex.charAt(i);
if ('0' <= ch && ch <= '9')
digit = ch -... | java | public static byte []toBytes(String hex)
{
if (hex == null)
return null;
int len = hex.length();
byte []bytes = new byte[len / 2];
int k = 0;
for (int i = 0; i < len; i += 2) {
int digit = 0;
char ch = hex.charAt(i);
if ('0' <= ch && ch <= '9')
digit = ch -... | [
"public",
"static",
"byte",
"[",
"]",
"toBytes",
"(",
"String",
"hex",
")",
"{",
"if",
"(",
"hex",
"==",
"null",
")",
"return",
"null",
";",
"int",
"len",
"=",
"hex",
".",
"length",
"(",
")",
";",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
... | Convert hex to bytes | [
"Convert",
"hex",
"to",
"bytes"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/Hex.java#L109-L144 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/util/CauchoUtil.java | CauchoUtil.loadClass | public static Class<?> loadClass(String name, boolean init, ClassLoader loader)
throws ClassNotFoundException
{
if (loader == null)
loader = Thread.currentThread().getContextClassLoader();
if (loader == null || loader.equals(CauchoUtil.class.getClassLoader()))
return Class.forName(name);
... | java | public static Class<?> loadClass(String name, boolean init, ClassLoader loader)
throws ClassNotFoundException
{
if (loader == null)
loader = Thread.currentThread().getContextClassLoader();
if (loader == null || loader.equals(CauchoUtil.class.getClassLoader()))
return Class.forName(name);
... | [
"public",
"static",
"Class",
"<",
"?",
">",
"loadClass",
"(",
"String",
"name",
",",
"boolean",
"init",
",",
"ClassLoader",
"loader",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"loader",
"==",
"null",
")",
"loader",
"=",
"Thread",
".",
"curre... | Loads a class from a classloader. If the loader is null, uses the
context class loader.
@param name the classname, separated by '.'
@param init if true, resolves the class instances
@param loader the class loader
@return the loaded class. | [
"Loads",
"a",
"class",
"from",
"a",
"classloader",
".",
"If",
"the",
"loader",
"is",
"null",
"uses",
"the",
"context",
"class",
"loader",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/CauchoUtil.java#L311-L321 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/http/protocol2/OutResponseHttp2.java | OutResponseHttp2.flush | @Override
protected void flush(Buffer data, boolean isEnd)
{
if (isClosed()) {
throw new IllegalStateException();
}
_request.outProxy().write(_request, data, isEnd);
/*
boolean isHeader = ! isCommitted();
toCommitted();
MessageResponseHttp2 message;
TempBuffer n... | java | @Override
protected void flush(Buffer data, boolean isEnd)
{
if (isClosed()) {
throw new IllegalStateException();
}
_request.outProxy().write(_request, data, isEnd);
/*
boolean isHeader = ! isCommitted();
toCommitted();
MessageResponseHttp2 message;
TempBuffer n... | [
"@",
"Override",
"protected",
"void",
"flush",
"(",
"Buffer",
"data",
",",
"boolean",
"isEnd",
")",
"{",
"if",
"(",
"isClosed",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"}",
"_request",
".",
"outProxy",
"(",
")",
".",... | Writes data to the output. If the headers have not been written,
they should be written. | [
"Writes",
"data",
"to",
"the",
"output",
".",
"If",
"the",
"headers",
"have",
"not",
"been",
"written",
"they",
"should",
"be",
"written",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol2/OutResponseHttp2.java#L79-L112 | train |
optimaize/anythingworks | client/rest/src/main/java/com/optimaize/anythingworks/client/rest/http/RestHttpClientImpl.java | RestHttpClientImpl.getClient | private Client getClient() {
Client client = hostMap.get(basePath);
if (client!=null) return client;
final ClientConfig clientConfig = new ClientConfig();
clientConfig.register(MultiPartFeature.class);
if (debug) {
clientConfig.register(LoggingFilter.class);
... | java | private Client getClient() {
Client client = hostMap.get(basePath);
if (client!=null) return client;
final ClientConfig clientConfig = new ClientConfig();
clientConfig.register(MultiPartFeature.class);
if (debug) {
clientConfig.register(LoggingFilter.class);
... | [
"private",
"Client",
"getClient",
"(",
")",
"{",
"Client",
"client",
"=",
"hostMap",
".",
"get",
"(",
"basePath",
")",
";",
"if",
"(",
"client",
"!=",
"null",
")",
"return",
"client",
";",
"final",
"ClientConfig",
"clientConfig",
"=",
"new",
"ClientConfig"... | Get an existing client or create a new client to handle HTTP request. | [
"Get",
"an",
"existing",
"client",
"or",
"create",
"a",
"new",
"client",
"to",
"handle",
"HTTP",
"request",
"."
] | 23e5f1c63cd56d935afaac4ad033c7996b32a1f2 | https://github.com/optimaize/anythingworks/blob/23e5f1c63cd56d935afaac4ad033c7996b32a1f2/client/rest/src/main/java/com/optimaize/anythingworks/client/rest/http/RestHttpClientImpl.java#L604-L617 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/http/protocol/ConnectionHttp.java | ConnectionHttp.onAccept | @Override
public void onAccept()
{
if (_request != null) {
System.out.println("OLD_REQUEST: " + _request);
}
_sequenceClose.set(-1);
/*
_request = protocol().newRequest(this);
_request.onAccept();
*/
} | java | @Override
public void onAccept()
{
if (_request != null) {
System.out.println("OLD_REQUEST: " + _request);
}
_sequenceClose.set(-1);
/*
_request = protocol().newRequest(this);
_request.onAccept();
*/
} | [
"@",
"Override",
"public",
"void",
"onAccept",
"(",
")",
"{",
"if",
"(",
"_request",
"!=",
"null",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"OLD_REQUEST: \"",
"+",
"_request",
")",
";",
"}",
"_sequenceClose",
".",
"set",
"(",
"-",
"1",
... | Called first when the connection is first accepted. | [
"Called",
"first",
"when",
"the",
"connection",
"is",
"first",
"accepted",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/ConnectionHttp.java#L185-L197 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/http/protocol/ConnectionHttp.java | ConnectionHttp.service | @Override
public StateConnection service()
throws IOException
{
try {
ConnectionProtocol request = requestOrCreate();
if (request == null) {
log.warning("Unexpected empty request: " + this);
return StateConnection.CLOSE;
}
//_requestHttp.parseInvocati... | java | @Override
public StateConnection service()
throws IOException
{
try {
ConnectionProtocol request = requestOrCreate();
if (request == null) {
log.warning("Unexpected empty request: " + this);
return StateConnection.CLOSE;
}
//_requestHttp.parseInvocati... | [
"@",
"Override",
"public",
"StateConnection",
"service",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"ConnectionProtocol",
"request",
"=",
"requestOrCreate",
"(",
")",
";",
"if",
"(",
"request",
"==",
"null",
")",
"{",
"log",
".",
"warning",
"(",
"... | Service a HTTP request.
@return the next state for the read thread | [
"Service",
"a",
"HTTP",
"request",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/ConnectionHttp.java#L214-L259 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/http/protocol/ConnectionHttp.java | ConnectionHttp.onCloseRead | @Override
public StateConnection onCloseRead()
{
ConnectionProtocol request = request();
if (request != null) {
request.onCloseRead();
}
_sequenceClose.set(_sequenceRead.get());
if (_sequenceFlush.get() < _sequenceClose.get()) {
_isClosePending.set(true);
... | java | @Override
public StateConnection onCloseRead()
{
ConnectionProtocol request = request();
if (request != null) {
request.onCloseRead();
}
_sequenceClose.set(_sequenceRead.get());
if (_sequenceFlush.get() < _sequenceClose.get()) {
_isClosePending.set(true);
... | [
"@",
"Override",
"public",
"StateConnection",
"onCloseRead",
"(",
")",
"{",
"ConnectionProtocol",
"request",
"=",
"request",
"(",
")",
";",
"if",
"(",
"request",
"!=",
"null",
")",
"{",
"request",
".",
"onCloseRead",
"(",
")",
";",
"}",
"_sequenceClose",
"... | Called by reader thread on reader end of file. | [
"Called",
"by",
"reader",
"thread",
"on",
"reader",
"end",
"of",
"file",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/ConnectionHttp.java#L264-L290 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/http/protocol/ConnectionHttp.java | ConnectionHttp.isWriteComplete | public boolean isWriteComplete()
{
long seqClose = _sequenceClose.get();
long seqWrite = _sequenceWrite.get();
return seqClose > 0 && seqClose <= seqWrite;
} | java | public boolean isWriteComplete()
{
long seqClose = _sequenceClose.get();
long seqWrite = _sequenceWrite.get();
return seqClose > 0 && seqClose <= seqWrite;
} | [
"public",
"boolean",
"isWriteComplete",
"(",
")",
"{",
"long",
"seqClose",
"=",
"_sequenceClose",
".",
"get",
"(",
")",
";",
"long",
"seqWrite",
"=",
"_sequenceWrite",
".",
"get",
"(",
")",
";",
"return",
"seqClose",
">",
"0",
"&&",
"seqClose",
"<=",
"se... | The last write has completed after the read. | [
"The",
"last",
"write",
"has",
"completed",
"after",
"the",
"read",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/ConnectionHttp.java#L302-L308 | train |
SeaCloudsEU/SeaCloudsPlatform | planner/matchmaker/src/main/java/eu/seaclouds/planner/matchmaker/Matchmaker.java | Matchmaker.match | @Deprecated
public Map<String, HashSet<String>> match(Map<String, IndexedNodeType> aamModules, Map<String, NodeTemplate> offerings){
Map<String, HashSet<String>> mathedOfferings = new HashMap<>();
for(String moduleName: aamModules.keySet()){
IndexedNodeType module = aamModules.get(modul... | java | @Deprecated
public Map<String, HashSet<String>> match(Map<String, IndexedNodeType> aamModules, Map<String, NodeTemplate> offerings){
Map<String, HashSet<String>> mathedOfferings = new HashMap<>();
for(String moduleName: aamModules.keySet()){
IndexedNodeType module = aamModules.get(modul... | [
"@",
"Deprecated",
"public",
"Map",
"<",
"String",
",",
"HashSet",
"<",
"String",
">",
">",
"match",
"(",
"Map",
"<",
"String",
",",
"IndexedNodeType",
">",
"aamModules",
",",
"Map",
"<",
"String",
",",
"NodeTemplate",
">",
"offerings",
")",
"{",
"Map",
... | Matches for each module the technical requirement with the available offerings.
@param aamModules the map of the application modules, taken from the abstract application modules.
@param offerings the map containing the available offerings.
@return for each module name, a set of suitable matched offerings. | [
"Matches",
"for",
"each",
"module",
"the",
"technical",
"requirement",
"with",
"the",
"available",
"offerings",
"."
] | b199fe6de2c63b808cb248d3aca947d802375df8 | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/planner/matchmaker/src/main/java/eu/seaclouds/planner/matchmaker/Matchmaker.java#L147-L164 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/util/URLUtil.java | URLUtil.encodeURL | public static String encodeURL(String uri)
{
CharBuffer cb = CharBuffer.allocate();
for (int i = 0; i < uri.length(); i++) {
char ch = uri.charAt(i);
switch (ch) {
case '<':
case '>':
case ' ':
case '%':
case '\'':
case '\"':
cb.append('%');
cb... | java | public static String encodeURL(String uri)
{
CharBuffer cb = CharBuffer.allocate();
for (int i = 0; i < uri.length(); i++) {
char ch = uri.charAt(i);
switch (ch) {
case '<':
case '>':
case ' ':
case '%':
case '\'':
case '\"':
cb.append('%');
cb... | [
"public",
"static",
"String",
"encodeURL",
"(",
"String",
"uri",
")",
"{",
"CharBuffer",
"cb",
"=",
"CharBuffer",
".",
"allocate",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"uri",
".",
"length",
"(",
")",
";",
"i",
"++",
")"... | Encode the url with '%' encoding. | [
"Encode",
"the",
"url",
"with",
"%",
"encoding",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/URLUtil.java#L38-L63 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/util/AlarmClock.java | AlarmClock.extractAlarm | public long extractAlarm(long now, boolean isTest)
{
long lastTime = _now.getAndSet(now);
long nextTime = _nextAlarmTime.get();
if (now < nextTime) {
return nextTime;
}
_nextAlarmTime.set(now + CLOCK_NEXT);
int delta;
delta = (int) (now - lastTime) / CLOCK_INTERV... | java | public long extractAlarm(long now, boolean isTest)
{
long lastTime = _now.getAndSet(now);
long nextTime = _nextAlarmTime.get();
if (now < nextTime) {
return nextTime;
}
_nextAlarmTime.set(now + CLOCK_NEXT);
int delta;
delta = (int) (now - lastTime) / CLOCK_INTERV... | [
"public",
"long",
"extractAlarm",
"(",
"long",
"now",
",",
"boolean",
"isTest",
")",
"{",
"long",
"lastTime",
"=",
"_now",
".",
"getAndSet",
"(",
"now",
")",
";",
"long",
"nextTime",
"=",
"_nextAlarmTime",
".",
"get",
"(",
")",
";",
"if",
"(",
"now",
... | Returns the next alarm ready to run | [
"Returns",
"the",
"next",
"alarm",
"ready",
"to",
"run"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/AlarmClock.java#L232-L273 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/InetAddressUtil.java | InetAddressUtil.createIpAddress | public static int createIpAddress(byte []address, char []buffer)
{
if (isIpv4(address)) {
return createIpv4Address(address, 0, buffer, 0);
}
int offset = 0;
boolean isZeroCompress = false;
boolean isInZeroCompress = false;
buffer[offset++] = '[';
for (int i = 0; i < 16; i += 2) {
... | java | public static int createIpAddress(byte []address, char []buffer)
{
if (isIpv4(address)) {
return createIpv4Address(address, 0, buffer, 0);
}
int offset = 0;
boolean isZeroCompress = false;
boolean isInZeroCompress = false;
buffer[offset++] = '[';
for (int i = 0; i < 16; i += 2) {
... | [
"public",
"static",
"int",
"createIpAddress",
"(",
"byte",
"[",
"]",
"address",
",",
"char",
"[",
"]",
"buffer",
")",
"{",
"if",
"(",
"isIpv4",
"(",
"address",
")",
")",
"{",
"return",
"createIpv4Address",
"(",
"address",
",",
"0",
",",
"buffer",
",",
... | Convert a system ip address to an actual address. | [
"Convert",
"a",
"system",
"ip",
"address",
"to",
"an",
"actual",
"address",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/InetAddressUtil.java#L19-L67 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/HttpStreamWrapper.java | HttpStreamWrapper.setAttribute | public void setAttribute(String name, Object value)
{
if (_stream != null) {
_stream.setAttribute(name, value);
}
} | java | public void setAttribute(String name, Object value)
{
if (_stream != null) {
_stream.setAttribute(name, value);
}
} | [
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"_stream",
"!=",
"null",
")",
"{",
"_stream",
".",
"setAttribute",
"(",
"name",
",",
"value",
")",
";",
"}",
"}"
] | Sets a header for the request. | [
"Sets",
"a",
"header",
"for",
"the",
"request",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/HttpStreamWrapper.java#L151-L156 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/pod/UpdatePodBuilder.java | UpdatePodBuilder.name | public UpdatePodBuilder name(String name)
{
Objects.requireNonNull(name);
if (name.indexOf('.') >= 0) {
throw new IllegalArgumentException(name);
}
_name = name;
return this;
} | java | public UpdatePodBuilder name(String name)
{
Objects.requireNonNull(name);
if (name.indexOf('.') >= 0) {
throw new IllegalArgumentException(name);
}
_name = name;
return this;
} | [
"public",
"UpdatePodBuilder",
"name",
"(",
"String",
"name",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"name",
")",
";",
"if",
"(",
"name",
".",
"indexOf",
"(",
"'",
"'",
")",
">=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
... | name is the name of the pod | [
"name",
"is",
"the",
"name",
"of",
"the",
"pod"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/UpdatePodBuilder.java#L86-L97 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/pod/UpdatePodBuilder.java | UpdatePodBuilder.build | public UpdatePod build()
{
if (getServers() == null) {
int count = Math.max(_primaryServerCount, _depth);
if (_type == PodType.off) {
count = 0;
}
_servers = buildServers(count);
}
Objects.requireNonNull(getServers());
/*
if (getServers().length < _prim... | java | public UpdatePod build()
{
if (getServers() == null) {
int count = Math.max(_primaryServerCount, _depth);
if (_type == PodType.off) {
count = 0;
}
_servers = buildServers(count);
}
Objects.requireNonNull(getServers());
/*
if (getServers().length < _prim... | [
"public",
"UpdatePod",
"build",
"(",
")",
"{",
"if",
"(",
"getServers",
"(",
")",
"==",
"null",
")",
"{",
"int",
"count",
"=",
"Math",
".",
"max",
"(",
"_primaryServerCount",
",",
"_depth",
")",
";",
"if",
"(",
"_type",
"==",
"PodType",
".",
"off",
... | Builds the configured pod. | [
"Builds",
"the",
"configured",
"pod",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/UpdatePodBuilder.java#L342-L362 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/StreamSource.java | StreamSource.getLength | public long getLength()
{
StreamSource indirectSource = _indirectSource;
if (indirectSource != null) {
return indirectSource.getLength();
}
TempOutputStream out = _out;
if (out != null) {
return out.getLength();
}
else {
return -1;
}
} | java | public long getLength()
{
StreamSource indirectSource = _indirectSource;
if (indirectSource != null) {
return indirectSource.getLength();
}
TempOutputStream out = _out;
if (out != null) {
return out.getLength();
}
else {
return -1;
}
} | [
"public",
"long",
"getLength",
"(",
")",
"{",
"StreamSource",
"indirectSource",
"=",
"_indirectSource",
";",
"if",
"(",
"indirectSource",
"!=",
"null",
")",
"{",
"return",
"indirectSource",
".",
"getLength",
"(",
")",
";",
"}",
"TempOutputStream",
"out",
"=",
... | Returns the length of the stream, if known. | [
"Returns",
"the",
"length",
"of",
"the",
"stream",
"if",
"known",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/StreamSource.java#L107-L123 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/StreamSource.java | StreamSource.freeUseCount | public void freeUseCount()
{
if (_indirectSource != null) {
_indirectSource.freeUseCount();
}
else if (_useCount != null) {
if (_useCount.decrementAndGet() < 0) {
closeSelf();
}
}
} | java | public void freeUseCount()
{
if (_indirectSource != null) {
_indirectSource.freeUseCount();
}
else if (_useCount != null) {
if (_useCount.decrementAndGet() < 0) {
closeSelf();
}
}
} | [
"public",
"void",
"freeUseCount",
"(",
")",
"{",
"if",
"(",
"_indirectSource",
"!=",
"null",
")",
"{",
"_indirectSource",
".",
"freeUseCount",
"(",
")",
";",
"}",
"else",
"if",
"(",
"_useCount",
"!=",
"null",
")",
"{",
"if",
"(",
"_useCount",
".",
"dec... | Frees a use-counter, so getInputStream can be called multiple times. | [
"Frees",
"a",
"use",
"-",
"counter",
"so",
"getInputStream",
"can",
"be",
"called",
"multiple",
"times",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/StreamSource.java#L141-L151 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/StreamSource.java | StreamSource.openInputStream | public InputStream openInputStream()
throws IOException
{
StreamSource indirectSource = _indirectSource;
if (indirectSource != null) {
return indirectSource.openInputStream();
}
TempOutputStream out = _out;
if (out != null) {
return out.openInputStreamNoFree();
}
... | java | public InputStream openInputStream()
throws IOException
{
StreamSource indirectSource = _indirectSource;
if (indirectSource != null) {
return indirectSource.openInputStream();
}
TempOutputStream out = _out;
if (out != null) {
return out.openInputStreamNoFree();
}
... | [
"public",
"InputStream",
"openInputStream",
"(",
")",
"throws",
"IOException",
"{",
"StreamSource",
"indirectSource",
"=",
"_indirectSource",
";",
"if",
"(",
"indirectSource",
"!=",
"null",
")",
"{",
"return",
"indirectSource",
".",
"openInputStream",
"(",
")",
";... | Returns an input stream, without freeing the results | [
"Returns",
"an",
"input",
"stream",
"without",
"freeing",
"the",
"results"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/StreamSource.java#L171-L188 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/json/ser/JsonFactory.java | JsonFactory.serializer | public final <T> SerializerJson<T> serializer(Class<T> cl)
{
return (SerializerJson) _serMap.get(cl);
} | java | public final <T> SerializerJson<T> serializer(Class<T> cl)
{
return (SerializerJson) _serMap.get(cl);
} | [
"public",
"final",
"<",
"T",
">",
"SerializerJson",
"<",
"T",
">",
"serializer",
"(",
"Class",
"<",
"T",
">",
"cl",
")",
"{",
"return",
"(",
"SerializerJson",
")",
"_serMap",
".",
"get",
"(",
"cl",
")",
";",
"}"
] | The serializer for the given class. | [
"The",
"serializer",
"for",
"the",
"given",
"class",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/json/ser/JsonFactory.java#L112-L115 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/json/ser/JsonFactory.java | JsonFactory.serializer | public final <T> SerializerJson<T> serializer(Type type)
{
SerializerJson<T> ser = (SerializerJson<T>) _serTypeMap.get(type);
if (ser == null) {
TypeRef typeRef = TypeRef.of(type);
Class<T> rawClass = (Class<T>) typeRef.rawClass();
ser = serializer(rawClass).withType(typeRef, thi... | java | public final <T> SerializerJson<T> serializer(Type type)
{
SerializerJson<T> ser = (SerializerJson<T>) _serTypeMap.get(type);
if (ser == null) {
TypeRef typeRef = TypeRef.of(type);
Class<T> rawClass = (Class<T>) typeRef.rawClass();
ser = serializer(rawClass).withType(typeRef, thi... | [
"public",
"final",
"<",
"T",
">",
"SerializerJson",
"<",
"T",
">",
"serializer",
"(",
"Type",
"type",
")",
"{",
"SerializerJson",
"<",
"T",
">",
"ser",
"=",
"(",
"SerializerJson",
"<",
"T",
">",
")",
"_serTypeMap",
".",
"get",
"(",
"type",
")",
";",
... | The serializer for the given type. | [
"The",
"serializer",
"for",
"the",
"given",
"type",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/json/ser/JsonFactory.java#L120-L136 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java | JarWithFile.getJarDepend | private JarDepend getJarDepend()
{
if (_depend == null || _depend.isModified())
_depend = new JarDepend(new Depend(getBacking()));
return _depend;
} | java | private JarDepend getJarDepend()
{
if (_depend == null || _depend.isModified())
_depend = new JarDepend(new Depend(getBacking()));
return _depend;
} | [
"private",
"JarDepend",
"getJarDepend",
"(",
")",
"{",
"if",
"(",
"_depend",
"==",
"null",
"||",
"_depend",
".",
"isModified",
"(",
")",
")",
"_depend",
"=",
"new",
"JarDepend",
"(",
"new",
"Depend",
"(",
"getBacking",
"(",
")",
")",
")",
";",
"return"... | Returns the dependency. | [
"Returns",
"the",
"dependency",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java#L128-L134 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java | JarWithFile.getCertificates | public Certificate []getCertificates(String path)
{
if (! isSigned())
return null;
if (path.length() > 0 && path.charAt(0) == '/')
path = path.substring(1);
try {
if (! getBacking().canRead())
return null;
JarFile jarFile = getJarFile();
JarEntry entry;
... | java | public Certificate []getCertificates(String path)
{
if (! isSigned())
return null;
if (path.length() > 0 && path.charAt(0) == '/')
path = path.substring(1);
try {
if (! getBacking().canRead())
return null;
JarFile jarFile = getJarFile();
JarEntry entry;
... | [
"public",
"Certificate",
"[",
"]",
"getCertificates",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"!",
"isSigned",
"(",
")",
")",
"return",
"null",
";",
"if",
"(",
"path",
".",
"length",
"(",
")",
">",
"0",
"&&",
"path",
".",
"charAt",
"(",
"0",
... | Returns any certificates. | [
"Returns",
"any",
"certificates",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java#L209-L248 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java | JarWithFile.getLastModified | public long getLastModified(String path)
{
try {
// this entry time can cause problems ...
ZipEntry entry = getZipEntry(path);
return entry != null ? entry.getTime() : -1;
} catch (IOException e) {
log.log(Level.FINE, e.toString(), e);
}
return -1;
} | java | public long getLastModified(String path)
{
try {
// this entry time can cause problems ...
ZipEntry entry = getZipEntry(path);
return entry != null ? entry.getTime() : -1;
} catch (IOException e) {
log.log(Level.FINE, e.toString(), e);
}
return -1;
} | [
"public",
"long",
"getLastModified",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"// this entry time can cause problems ...",
"ZipEntry",
"entry",
"=",
"getZipEntry",
"(",
"path",
")",
";",
"return",
"entry",
"!=",
"null",
"?",
"entry",
".",
"getTime",
"(",
"... | Returns the last-modified time of the entry in the jar file.
@param path full path to the jar entry
@return the length of the entry | [
"Returns",
"the",
"last",
"-",
"modified",
"time",
"of",
"the",
"entry",
"in",
"the",
"jar",
"file",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java#L313-L325 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java | JarWithFile.getLength | public long getLength(String path)
{
try {
ZipEntry entry = getZipEntry(path);
long length = entry != null ? entry.getSize() : -1;
return length;
} catch (IOException e) {
log.log(Level.FINE, e.toString(), e);
return -1;
}
} | java | public long getLength(String path)
{
try {
ZipEntry entry = getZipEntry(path);
long length = entry != null ? entry.getSize() : -1;
return length;
} catch (IOException e) {
log.log(Level.FINE, e.toString(), e);
return -1;
}
} | [
"public",
"long",
"getLength",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"ZipEntry",
"entry",
"=",
"getZipEntry",
"(",
"path",
")",
";",
"long",
"length",
"=",
"entry",
"!=",
"null",
"?",
"entry",
".",
"getSize",
"(",
")",
":",
"-",
"1",
";",
"r... | Returns the length of the entry in the jar file.
@param path full path to the jar entry
@return the length of the entry | [
"Returns",
"the",
"length",
"of",
"the",
"entry",
"in",
"the",
"jar",
"file",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java#L333-L346 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java | JarWithFile.canRead | public boolean canRead(String path)
{
try {
ZipEntry entry = getZipEntry(path);
return entry != null && ! entry.isDirectory();
} catch (IOException e) {
log.log(Level.FINE, e.toString(), e);
return false;
}
} | java | public boolean canRead(String path)
{
try {
ZipEntry entry = getZipEntry(path);
return entry != null && ! entry.isDirectory();
} catch (IOException e) {
log.log(Level.FINE, e.toString(), e);
return false;
}
} | [
"public",
"boolean",
"canRead",
"(",
"String",
"path",
")",
"{",
"try",
"{",
"ZipEntry",
"entry",
"=",
"getZipEntry",
"(",
"path",
")",
";",
"return",
"entry",
"!=",
"null",
"&&",
"!",
"entry",
".",
"isDirectory",
"(",
")",
";",
"}",
"catch",
"(",
"I... | Readable if the jar is readable and the path refers to a file. | [
"Readable",
"if",
"the",
"jar",
"is",
"readable",
"and",
"the",
"path",
"refers",
"to",
"a",
"file",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java#L351-L362 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java | JarWithFile.clearCache | public void clearCache()
{
ZipFile zipFile = _zipFileRef.getAndSet(null);
if (zipFile != null)
try {
zipFile.close();
} catch (Exception e) {
}
} | java | public void clearCache()
{
ZipFile zipFile = _zipFileRef.getAndSet(null);
if (zipFile != null)
try {
zipFile.close();
} catch (Exception e) {
}
} | [
"public",
"void",
"clearCache",
"(",
")",
"{",
"ZipFile",
"zipFile",
"=",
"_zipFileRef",
".",
"getAndSet",
"(",
"null",
")",
";",
"if",
"(",
"zipFile",
"!=",
"null",
")",
"try",
"{",
"zipFile",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Excepti... | Clears any cached JarFile. | [
"Clears",
"any",
"cached",
"JarFile",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/JarWithFile.java#L473-L482 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/http/pod/PodLoader.java | PodLoader.buildClassLoader | public ClassLoader buildClassLoader(ClassLoader serviceLoader)
{
synchronized (_loaderMap) {
SoftReference<ClassLoader> extLoaderRef = _loaderMap.get(serviceLoader);
if (extLoaderRef != null) {
ClassLoader extLoader = extLoaderRef.get();
if (extLoader != null) {
... | java | public ClassLoader buildClassLoader(ClassLoader serviceLoader)
{
synchronized (_loaderMap) {
SoftReference<ClassLoader> extLoaderRef = _loaderMap.get(serviceLoader);
if (extLoaderRef != null) {
ClassLoader extLoader = extLoaderRef.get();
if (extLoader != null) {
... | [
"public",
"ClassLoader",
"buildClassLoader",
"(",
"ClassLoader",
"serviceLoader",
")",
"{",
"synchronized",
"(",
"_loaderMap",
")",
"{",
"SoftReference",
"<",
"ClassLoader",
">",
"extLoaderRef",
"=",
"_loaderMap",
".",
"get",
"(",
"serviceLoader",
")",
";",
"if",
... | Builds a combined class-loader with the target service loader as a
parent, and this calling pod loader as a child. | [
"Builds",
"a",
"combined",
"class",
"-",
"loader",
"with",
"the",
"target",
"service",
"loader",
"as",
"a",
"parent",
"and",
"this",
"calling",
"pod",
"loader",
"as",
"a",
"child",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/http/pod/PodLoader.java#L191-L237 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/heartbeat/RootHeartbeat.java | RootHeartbeat.getServer | @Override
public ServerHeartbeat getServer(String serverId)
{
ServerHeartbeat server = _serverMap.get(serverId);
return server;
} | java | @Override
public ServerHeartbeat getServer(String serverId)
{
ServerHeartbeat server = _serverMap.get(serverId);
return server;
} | [
"@",
"Override",
"public",
"ServerHeartbeat",
"getServer",
"(",
"String",
"serverId",
")",
"{",
"ServerHeartbeat",
"server",
"=",
"_serverMap",
".",
"get",
"(",
"serverId",
")",
";",
"return",
"server",
";",
"}"
] | Returns the server with the given canonical id. | [
"Returns",
"the",
"server",
"with",
"the",
"given",
"canonical",
"id",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/RootHeartbeat.java#L104-L110 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/heartbeat/RootHeartbeat.java | RootHeartbeat.findServerByName | @Override
public ServerBartender findServerByName(String name)
{
for (ClusterHeartbeat cluster : _clusterMap.values()) {
ServerBartender server = cluster.findServerByName(name);
if (server != null) {
return server;
}
}
return null;
} | java | @Override
public ServerBartender findServerByName(String name)
{
for (ClusterHeartbeat cluster : _clusterMap.values()) {
ServerBartender server = cluster.findServerByName(name);
if (server != null) {
return server;
}
}
return null;
} | [
"@",
"Override",
"public",
"ServerBartender",
"findServerByName",
"(",
"String",
"name",
")",
"{",
"for",
"(",
"ClusterHeartbeat",
"cluster",
":",
"_clusterMap",
".",
"values",
"(",
")",
")",
"{",
"ServerBartender",
"server",
"=",
"cluster",
".",
"findServerByNa... | Returns the server with the given display name. | [
"Returns",
"the",
"server",
"with",
"the",
"given",
"display",
"name",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/RootHeartbeat.java#L115-L127 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/heartbeat/RootHeartbeat.java | RootHeartbeat.createCluster | ClusterHeartbeat createCluster(String clusterName)
{
ClusterHeartbeat cluster = _clusterMap.get(clusterName);
if (cluster == null) {
cluster = new ClusterHeartbeat(clusterName, this);
_clusterMap.putIfAbsent(clusterName, cluster);
cluster = _clusterMap.get(clusterName);
... | java | ClusterHeartbeat createCluster(String clusterName)
{
ClusterHeartbeat cluster = _clusterMap.get(clusterName);
if (cluster == null) {
cluster = new ClusterHeartbeat(clusterName, this);
_clusterMap.putIfAbsent(clusterName, cluster);
cluster = _clusterMap.get(clusterName);
... | [
"ClusterHeartbeat",
"createCluster",
"(",
"String",
"clusterName",
")",
"{",
"ClusterHeartbeat",
"cluster",
"=",
"_clusterMap",
".",
"get",
"(",
"clusterName",
")",
";",
"if",
"(",
"cluster",
"==",
"null",
")",
"{",
"cluster",
"=",
"new",
"ClusterHeartbeat",
"... | Returns the cluster with the given name, creating it if necessary. | [
"Returns",
"the",
"cluster",
"with",
"the",
"given",
"name",
"creating",
"it",
"if",
"necessary",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/RootHeartbeat.java#L197-L210 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.