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 | web/src/main/java/com/caucho/v5/io/StreamImplTee.java | StreamImplTee.read | @Override
public int read(byte []buffer, int offset, int length) throws IOException
{
int sublen = getDelegate().read(buffer, offset, length);
if (sublen > 0) {
logStream().write(buffer, offset, sublen);
}
return sublen;
} | java | @Override
public int read(byte []buffer, int offset, int length) throws IOException
{
int sublen = getDelegate().read(buffer, offset, length);
if (sublen > 0) {
logStream().write(buffer, offset, sublen);
}
return sublen;
} | [
"@",
"Override",
"public",
"int",
"read",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"int",
"sublen",
"=",
"getDelegate",
"(",
")",
".",
"read",
"(",
"buffer",
",",
"offset",
",",
"... | Reads the next chunk from the stream.
@param buffer byte array receiving the data.
@param offset starting offset into the array.
@param length number of bytes to read.
@return the number of bytes read or -1 on end of file. | [
"Reads",
"the",
"next",
"chunk",
"from",
"the",
"stream",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/StreamImplTee.java#L124-L134 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/StreamImplTee.java | StreamImplTee.readTimeout | @Override
public int readTimeout(byte []buffer, int offset, int length,
long timeout)
throws IOException
{
int sublen = getDelegate().readTimeout(buffer, offset, length, timeout);
if (sublen > 0) {
logStream().write(buffer, offset, sublen);
}
return sublen;
... | java | @Override
public int readTimeout(byte []buffer, int offset, int length,
long timeout)
throws IOException
{
int sublen = getDelegate().readTimeout(buffer, offset, length, timeout);
if (sublen > 0) {
logStream().write(buffer, offset, sublen);
}
return sublen;
... | [
"@",
"Override",
"public",
"int",
"readTimeout",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
",",
"long",
"timeout",
")",
"throws",
"IOException",
"{",
"int",
"sublen",
"=",
"getDelegate",
"(",
")",
".",
"readTimeout",
"(... | Reads the next chunk from the stream in non-blocking mode.
@param buffer byte array receiving the data.
@param offset starting offset into the array.
@param length number of bytes to read.
@return the number of bytes read, -1 on end of file, or 0 on timeout. | [
"Reads",
"the",
"next",
"chunk",
"from",
"the",
"stream",
"in",
"non",
"-",
"blocking",
"mode",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/StreamImplTee.java#L167-L178 | train |
SeaCloudsEU/SeaCloudsPlatform | dashboard/src/main/java/eu/seaclouds/platform/dashboard/util/ObjectMapperHelpers.java | ObjectMapperHelpers.ObjectToXml | public static String ObjectToXml(Object object) throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(object.getClass());
Marshaller marshaller = jaxbContext.createMarshaller();
StringWriter sw = new StringWriter();
marshaller.marshal(object, sw);
return sw.toS... | java | public static String ObjectToXml(Object object) throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(object.getClass());
Marshaller marshaller = jaxbContext.createMarshaller();
StringWriter sw = new StringWriter();
marshaller.marshal(object, sw);
return sw.toS... | [
"public",
"static",
"String",
"ObjectToXml",
"(",
"Object",
"object",
")",
"throws",
"JAXBException",
"{",
"JAXBContext",
"jaxbContext",
"=",
"JAXBContext",
".",
"newInstance",
"(",
"object",
".",
"getClass",
"(",
")",
")",
";",
"Marshaller",
"marshaller",
"=",
... | Transforms an annotated Object to a XML string using javax.xml.bind.Marshaller
@param object to transform to a XML String
@return a XML string representing the object
@throws IOException if is not possible to parse the object | [
"Transforms",
"an",
"annotated",
"Object",
"to",
"a",
"XML",
"string",
"using",
"javax",
".",
"xml",
".",
"bind",
".",
"Marshaller"
] | b199fe6de2c63b808cb248d3aca947d802375df8 | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/dashboard/src/main/java/eu/seaclouds/platform/dashboard/util/ObjectMapperHelpers.java#L128-L134 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/i18n/ByteToCharBase.java | ByteToCharBase.setEncoding | public void setEncoding(String encoding)
throws UnsupportedEncodingException
{
if (encoding != null) {
_readEncoding = Encoding.getReadEncoding(this, encoding);
_readEncodingName = Encoding.getMimeName(encoding);
}
else {
_readEncoding = null;
_readEncodingName = null;
}
... | java | public void setEncoding(String encoding)
throws UnsupportedEncodingException
{
if (encoding != null) {
_readEncoding = Encoding.getReadEncoding(this, encoding);
_readEncodingName = Encoding.getMimeName(encoding);
}
else {
_readEncoding = null;
_readEncodingName = null;
}
... | [
"public",
"void",
"setEncoding",
"(",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"encoding",
"!=",
"null",
")",
"{",
"_readEncoding",
"=",
"Encoding",
".",
"getReadEncoding",
"(",
"this",
",",
"encoding",
")",
";",
"_r... | Sets the encoding for the converter. | [
"Sets",
"the",
"encoding",
"for",
"the",
"converter",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/i18n/ByteToCharBase.java#L72-L83 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/i18n/ByteToCharBase.java | ByteToCharBase.addByte | public void addByte(int b)
throws IOException
{
int nextHead = (_byteHead + 1) % _byteBuffer.length;
while (nextHead == _byteTail) {
int ch = readChar();
if (ch < 0) {
break;
}
outputChar(ch);
}
_byteBuffer[_byteHead] = (byte) b;
_byteHead = nextHead;
} | java | public void addByte(int b)
throws IOException
{
int nextHead = (_byteHead + 1) % _byteBuffer.length;
while (nextHead == _byteTail) {
int ch = readChar();
if (ch < 0) {
break;
}
outputChar(ch);
}
_byteBuffer[_byteHead] = (byte) b;
_byteHead = nextHead;
} | [
"public",
"void",
"addByte",
"(",
"int",
"b",
")",
"throws",
"IOException",
"{",
"int",
"nextHead",
"=",
"(",
"_byteHead",
"+",
"1",
")",
"%",
"_byteBuffer",
".",
"length",
";",
"while",
"(",
"nextHead",
"==",
"_byteTail",
")",
"{",
"int",
"ch",
"=",
... | Adds the next byte.
@param b the byte to write | [
"Adds",
"the",
"next",
"byte",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/i18n/ByteToCharBase.java#L99-L116 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/i18n/ByteToCharBase.java | ByteToCharBase.addChar | public void addChar(char nextCh)
throws IOException
{
int ch;
while ((ch = readChar()) >= 0) {
outputChar((char) ch);
}
outputChar(nextCh);
} | java | public void addChar(char nextCh)
throws IOException
{
int ch;
while ((ch = readChar()) >= 0) {
outputChar((char) ch);
}
outputChar(nextCh);
} | [
"public",
"void",
"addChar",
"(",
"char",
"nextCh",
")",
"throws",
"IOException",
"{",
"int",
"ch",
";",
"while",
"(",
"(",
"ch",
"=",
"readChar",
"(",
")",
")",
">=",
"0",
")",
"{",
"outputChar",
"(",
"(",
"char",
")",
"ch",
")",
";",
"}",
"outp... | Adds the next character.
@param nextCh the character to write | [
"Adds",
"the",
"next",
"character",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/i18n/ByteToCharBase.java#L123-L133 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/i18n/ByteToCharBase.java | ByteToCharBase.readChar | private int readChar()
throws IOException
{
Reader readEncoding = _readEncoding;
if (readEncoding == null)
return read();
else {
if (readEncoding.read(_charBuffer, 0, 1) == 1) {
return _charBuffer[0];
}
else {
return -1;
}
}
} | java | private int readChar()
throws IOException
{
Reader readEncoding = _readEncoding;
if (readEncoding == null)
return read();
else {
if (readEncoding.read(_charBuffer, 0, 1) == 1) {
return _charBuffer[0];
}
else {
return -1;
}
}
} | [
"private",
"int",
"readChar",
"(",
")",
"throws",
"IOException",
"{",
"Reader",
"readEncoding",
"=",
"_readEncoding",
";",
"if",
"(",
"readEncoding",
"==",
"null",
")",
"return",
"read",
"(",
")",
";",
"else",
"{",
"if",
"(",
"readEncoding",
".",
"read",
... | Reads the next converted character. | [
"Reads",
"the",
"next",
"converted",
"character",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/i18n/ByteToCharBase.java#L151-L166 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/i18n/ByteToCharBase.java | ByteToCharBase.read | public int read()
throws IOException
{
if (_byteHead == _byteTail) {
return -1;
}
int b = _byteBuffer[_byteTail] & 0xff;
_byteTail = (_byteTail + 1) % _byteBuffer.length;
return b;
} | java | public int read()
throws IOException
{
if (_byteHead == _byteTail) {
return -1;
}
int b = _byteBuffer[_byteTail] & 0xff;
_byteTail = (_byteTail + 1) % _byteBuffer.length;
return b;
} | [
"public",
"int",
"read",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_byteHead",
"==",
"_byteTail",
")",
"{",
"return",
"-",
"1",
";",
"}",
"int",
"b",
"=",
"_byteBuffer",
"[",
"_byteTail",
"]",
"&",
"0xff",
";",
"_byteTail",
"=",
"(",
"_byte... | For internal use only. Reads the next byte from the byte buffer.
@return the next byte | [
"For",
"internal",
"use",
"only",
".",
"Reads",
"the",
"next",
"byte",
"from",
"the",
"byte",
"buffer",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/i18n/ByteToCharBase.java#L173-L184 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/bytecode/cpool/InterfaceMethodRefConstant.java | InterfaceMethodRefConstant.setNameAndType | public void setNameAndType(String name, String type)
{
_nameAndTypeIndex = getConstantPool().addNameAndType(name, type).getIndex();
} | java | public void setNameAndType(String name, String type)
{
_nameAndTypeIndex = getConstantPool().addNameAndType(name, type).getIndex();
} | [
"public",
"void",
"setNameAndType",
"(",
"String",
"name",
",",
"String",
"type",
")",
"{",
"_nameAndTypeIndex",
"=",
"getConstantPool",
"(",
")",
".",
"addNameAndType",
"(",
"name",
",",
"type",
")",
".",
"getIndex",
"(",
")",
";",
"}"
] | Sets the method name and type | [
"Sets",
"the",
"method",
"name",
"and",
"type"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/cpool/InterfaceMethodRefConstant.java#L81-L84 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/TableKelp.java | TableKelp.putWithVersion | public void putWithVersion(RowCursor cursor, Result<Boolean> cont)
{
_tableService.put(cursor, PutType.PUT, cont);
} | java | public void putWithVersion(RowCursor cursor, Result<Boolean> cont)
{
_tableService.put(cursor, PutType.PUT, cont);
} | [
"public",
"void",
"putWithVersion",
"(",
"RowCursor",
"cursor",
",",
"Result",
"<",
"Boolean",
">",
"cont",
")",
"{",
"_tableService",
".",
"put",
"(",
"cursor",
",",
"PutType",
".",
"PUT",
",",
"cont",
")",
";",
"}"
] | Put using the version in the cursor, instead of clearing it. | [
"Put",
"using",
"the",
"version",
"in",
"the",
"cursor",
"instead",
"of",
"clearing",
"it",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/TableKelp.java#L403-L406 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/DateFormatter.java | DateFormatter.format | void format(StringBuilder sb, Temporal localDate)
{
//Instant localDate = ClockCurrent.GMT.instant();
int len = _timestamp.length;
for (int j = 0; j < len; j++) {
_timestamp[j].format(sb, localDate);
}
} | java | void format(StringBuilder sb, Temporal localDate)
{
//Instant localDate = ClockCurrent.GMT.instant();
int len = _timestamp.length;
for (int j = 0; j < len; j++) {
_timestamp[j].format(sb, localDate);
}
} | [
"void",
"format",
"(",
"StringBuilder",
"sb",
",",
"Temporal",
"localDate",
")",
"{",
"//Instant localDate = ClockCurrent.GMT.instant();",
"int",
"len",
"=",
"_timestamp",
".",
"length",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"len",
";",
"j",
... | Formats the timestamp | [
"Formats",
"the",
"timestamp"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/DateFormatter.java#L80-L88 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java | TableWriterServiceImpl.writePage | @InService(TableWriterService.class)
public void writePage(Page page,
SegmentStream sOut,
long oldSequence,
int saveLength,
int saveTail,
int sequenceWrite,
Result<Integer> ... | java | @InService(TableWriterService.class)
public void writePage(Page page,
SegmentStream sOut,
long oldSequence,
int saveLength,
int saveTail,
int sequenceWrite,
Result<Integer> ... | [
"@",
"InService",
"(",
"TableWriterService",
".",
"class",
")",
"public",
"void",
"writePage",
"(",
"Page",
"page",
",",
"SegmentStream",
"sOut",
",",
"long",
"oldSequence",
",",
"int",
"saveLength",
",",
"int",
"saveTail",
",",
"int",
"sequenceWrite",
",",
... | Writes a page to the current segment
@param page
@param sOut
@param oldSequence
@param saveLength
@param saveTail
@param sequenceWrite page sequence to correlate write requests with
flush completions | [
"Writes",
"a",
"page",
"to",
"the",
"current",
"segment"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java#L419-L434 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java | TableWriterServiceImpl.writeBlobPage | @InService(TableWriterService.class)
public void writeBlobPage(PageBlob page,
int saveSequence,
Result<Integer> result)
{
SegmentStream sOut = getBlobStream();
int saveLength = 0;
int saveTail = 0;
if (_blobSizeMax < page.getLen... | java | @InService(TableWriterService.class)
public void writeBlobPage(PageBlob page,
int saveSequence,
Result<Integer> result)
{
SegmentStream sOut = getBlobStream();
int saveLength = 0;
int saveTail = 0;
if (_blobSizeMax < page.getLen... | [
"@",
"InService",
"(",
"TableWriterService",
".",
"class",
")",
"public",
"void",
"writeBlobPage",
"(",
"PageBlob",
"page",
",",
"int",
"saveSequence",
",",
"Result",
"<",
"Integer",
">",
"result",
")",
"{",
"SegmentStream",
"sOut",
"=",
"getBlobStream",
"(",
... | Writes a blob page to the current output segment.
@param page the blob to be written
@param saveSequence
@return true on completion | [
"Writes",
"a",
"blob",
"page",
"to",
"the",
"current",
"output",
"segment",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java#L443-L461 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java | TableWriterServiceImpl.openWriter | public OutSegment openWriter()
{
if (isGcRequired()) {
// _gcSequence = _seqGen.get();
_table.getGcService().gc(_seqGen.get());
_seqSinceGcCount = 0;
}
_seqSinceGcCount++;
long sequence = _seqGen.get();
return openWriterSeq(sequence);
} | java | public OutSegment openWriter()
{
if (isGcRequired()) {
// _gcSequence = _seqGen.get();
_table.getGcService().gc(_seqGen.get());
_seqSinceGcCount = 0;
}
_seqSinceGcCount++;
long sequence = _seqGen.get();
return openWriterSeq(sequence);
} | [
"public",
"OutSegment",
"openWriter",
"(",
")",
"{",
"if",
"(",
"isGcRequired",
"(",
")",
")",
"{",
"// _gcSequence = _seqGen.get();",
"_table",
".",
"getGcService",
"(",
")",
".",
"gc",
"(",
"_seqGen",
".",
"get",
"(",
")",
")",
";",
"_seqSinceGcCount",
"... | Opens a new segment writer. The segment's sequence id will be the next
sequence number.
@return the new segment writer | [
"Opens",
"a",
"new",
"segment",
"writer",
".",
"The",
"segment",
"s",
"sequence",
"id",
"will",
"be",
"the",
"next",
"sequence",
"number",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java#L503-L515 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java | TableWriterServiceImpl.calculateSegmentSize | private void calculateSegmentSize()
{
DatabaseKelp db = _table.database();
_segmentSizeNew = calculateSegmentSize(db.getSegmentSizeFactorNew(),
_segmentSizeNew);
_segmentSizeGc = calculateSegmentSize(db.getSegmentSizeFactorGc(),
... | java | private void calculateSegmentSize()
{
DatabaseKelp db = _table.database();
_segmentSizeNew = calculateSegmentSize(db.getSegmentSizeFactorNew(),
_segmentSizeNew);
_segmentSizeGc = calculateSegmentSize(db.getSegmentSizeFactorGc(),
... | [
"private",
"void",
"calculateSegmentSize",
"(",
")",
"{",
"DatabaseKelp",
"db",
"=",
"_table",
".",
"database",
"(",
")",
";",
"_segmentSizeNew",
"=",
"calculateSegmentSize",
"(",
"db",
".",
"getSegmentSizeFactorNew",
"(",
")",
",",
"_segmentSizeNew",
")",
";",
... | Calculates the dynamic segment size based on the current table size.
Small tables use small segments and large tables use large segments
to improve efficiency. A small table will have about 5 active segments
because of GC, which means a table with 64k live entries will still use
5 * minSegmentSize.
new segments: 1/64... | [
"Calculates",
"the",
"dynamic",
"segment",
"size",
"based",
"on",
"the",
"current",
"table",
"size",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java#L581-L590 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java | TableWriterServiceImpl.calculateSegmentSize | private int calculateSegmentSize(int factor, int segmentSizeOld)
{
DatabaseKelp db = _table.database();
long segmentFactor = _tableLength / db.getSegmentSizeMin();
long segmentFactorNew = segmentFactor / factor;
// segment size is (tableSize / factor), restricted to a power of 4
// ov... | java | private int calculateSegmentSize(int factor, int segmentSizeOld)
{
DatabaseKelp db = _table.database();
long segmentFactor = _tableLength / db.getSegmentSizeMin();
long segmentFactorNew = segmentFactor / factor;
// segment size is (tableSize / factor), restricted to a power of 4
// ov... | [
"private",
"int",
"calculateSegmentSize",
"(",
"int",
"factor",
",",
"int",
"segmentSizeOld",
")",
"{",
"DatabaseKelp",
"db",
"=",
"_table",
".",
"database",
"(",
")",
";",
"long",
"segmentFactor",
"=",
"_tableLength",
"/",
"db",
".",
"getSegmentSizeMin",
"(",... | Calculate the dynamic segment size.
The new segment size is a fraction of the current table size.
@param factor the target ratio compared to the table size
@param segmentSizeOld the previous segment size | [
"Calculate",
"the",
"dynamic",
"segment",
"size",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java#L600-L635 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java | TableWriterServiceImpl.fsync | public void fsync(Result<Boolean> result)
throws IOException
{
SegmentStream nodeStream = _nodeStream;
// FlushCompletion cont = new FlushCompletion(result, nodeStream, blobStream);
if (nodeStream != null) {
nodeStream.fsync(result);
}
else {
result.ok(true);
}
... | java | public void fsync(Result<Boolean> result)
throws IOException
{
SegmentStream nodeStream = _nodeStream;
// FlushCompletion cont = new FlushCompletion(result, nodeStream, blobStream);
if (nodeStream != null) {
nodeStream.fsync(result);
}
else {
result.ok(true);
}
... | [
"public",
"void",
"fsync",
"(",
"Result",
"<",
"Boolean",
">",
"result",
")",
"throws",
"IOException",
"{",
"SegmentStream",
"nodeStream",
"=",
"_nodeStream",
";",
"// FlushCompletion cont = new FlushCompletion(result, nodeStream, blobStream);",
"if",
"(",
"nodeStream",
"... | sync the output stream with the filesystem when possible. | [
"sync",
"the",
"output",
"stream",
"with",
"the",
"filesystem",
"when",
"possible",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java#L667-L680 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java | TableWriterServiceImpl.afterDeliver | @AfterBatch
public void afterDeliver()
{
SegmentStream nodeStream = _nodeStream;
if (nodeStream != null) {
if (_isBlobDirty) {
_isBlobDirty = false;
// nodeStream.flush(null);
nodeStream.fsync(Result.ignore());
}
else {
nodeStream.flush(Result.ignore()... | java | @AfterBatch
public void afterDeliver()
{
SegmentStream nodeStream = _nodeStream;
if (nodeStream != null) {
if (_isBlobDirty) {
_isBlobDirty = false;
// nodeStream.flush(null);
nodeStream.fsync(Result.ignore());
}
else {
nodeStream.flush(Result.ignore()... | [
"@",
"AfterBatch",
"public",
"void",
"afterDeliver",
"(",
")",
"{",
"SegmentStream",
"nodeStream",
"=",
"_nodeStream",
";",
"if",
"(",
"nodeStream",
"!=",
"null",
")",
"{",
"if",
"(",
"_isBlobDirty",
")",
"{",
"_isBlobDirty",
"=",
"false",
";",
"// nodeStrea... | Flushes the stream after a batch of writes.
If the writes included a blob write, the segment must be fsynced because
the blob is not saved in the journal. | [
"Flushes",
"the",
"stream",
"after",
"a",
"batch",
"of",
"writes",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java#L695-L721 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java | TableWriterServiceImpl.close | public void close(Result<Boolean> result)
{
_lifecycle.toDestroy();
SegmentStream nodeStream = _nodeStream;
_nodeStream = null;
if (nodeStream != null) {
nodeStream.closeFsync(result.then(v->closeImpl()));
}
else {
result.ok(true);
}
} | java | public void close(Result<Boolean> result)
{
_lifecycle.toDestroy();
SegmentStream nodeStream = _nodeStream;
_nodeStream = null;
if (nodeStream != null) {
nodeStream.closeFsync(result.then(v->closeImpl()));
}
else {
result.ok(true);
}
} | [
"public",
"void",
"close",
"(",
"Result",
"<",
"Boolean",
">",
"result",
")",
"{",
"_lifecycle",
".",
"toDestroy",
"(",
")",
";",
"SegmentStream",
"nodeStream",
"=",
"_nodeStream",
";",
"_nodeStream",
"=",
"null",
";",
"if",
"(",
"nodeStream",
"!=",
"null"... | Closes the store. | [
"Closes",
"the",
"store",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/TableWriterServiceImpl.java#L726-L739 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java | OutSegment.writePage | @InService(SegmentServiceImpl.class)
public
Page writePage(Page page,
long oldSequence,
int saveLength,
int saveTail,
int saveSequence,
Result<Integer> result)
{
if (isClosed()) {
return null;
}
// Type typ... | java | @InService(SegmentServiceImpl.class)
public
Page writePage(Page page,
long oldSequence,
int saveLength,
int saveTail,
int saveSequence,
Result<Integer> result)
{
if (isClosed()) {
return null;
}
// Type typ... | [
"@",
"InService",
"(",
"SegmentServiceImpl",
".",
"class",
")",
"public",
"Page",
"writePage",
"(",
"Page",
"page",
",",
"long",
"oldSequence",
",",
"int",
"saveLength",
",",
"int",
"saveTail",
",",
"int",
"saveSequence",
",",
"Result",
"<",
"Integer",
">",
... | Writes the page to the segment.
@param page
@param oldSequence
@param saveLength
@param saveTail
@param saveSequence
@return | [
"Writes",
"the",
"page",
"to",
"the",
"segment",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java#L228-L282 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java | OutSegment.flushData | public void flushData()
{
if (isClosed()) {
if (_pendingFlushEntries.size() > 0) {
System.out.println("PENDING_FLUSH");
}
return;
}
WriteStream out = _out;
if (out != null) {
try {
out.flush();
} catch (Exception e) {
log.log(Level.FINER, e.t... | java | public void flushData()
{
if (isClosed()) {
if (_pendingFlushEntries.size() > 0) {
System.out.println("PENDING_FLUSH");
}
return;
}
WriteStream out = _out;
if (out != null) {
try {
out.flush();
} catch (Exception e) {
log.log(Level.FINER, e.t... | [
"public",
"void",
"flushData",
"(",
")",
"{",
"if",
"(",
"isClosed",
"(",
")",
")",
"{",
"if",
"(",
"_pendingFlushEntries",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"PENDING_FLUSH\"",
")",
";",
"}",
"r... | Flushes the buffered data to the segment.
After the flush, pending entries are notified, allowing page stubs to
replace buffered pages. Since the written data is now in the mmap, the
buffered page can be gc'ed and replaced with a stub read. | [
"Flushes",
"the",
"buffered",
"data",
"to",
"the",
"segment",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java#L359-L380 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java | OutSegment.write | @Override
public void write(byte []buffer, int offset, int length,
boolean isEnd)
throws IOException
{
int position = _position;
if (length < 0) {
throw new IllegalArgumentException();
}
if (_indexAddress < position + length) {
throw new IllegalArgumentE... | java | @Override
public void write(byte []buffer, int offset, int length,
boolean isEnd)
throws IOException
{
int position = _position;
if (length < 0) {
throw new IllegalArgumentException();
}
if (_indexAddress < position + length) {
throw new IllegalArgumentE... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
",",
"boolean",
"isEnd",
")",
"throws",
"IOException",
"{",
"int",
"position",
"=",
"_position",
";",
"if",
"(",
"length",
"<",
"0"... | Writes to the file from the WriteStream flush.
After the write, a read from the mmap will succeed, but the headers
cannot be written until after the fsync. | [
"Writes",
"to",
"the",
"file",
"from",
"the",
"WriteStream",
"flush",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java#L388-L417 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java | OutSegment.completePendingFlush | private void completePendingFlush()
{
int size = _pendingFlushEntries.size();
if (size == 0) {
return;
}
// ArrayList<TableService.PageFlush> pageList = new ArrayList<>();
for (int i = 0; i < size; i++) {
PendingEntry entry = _pendingFlushEntries.get(i);
entry.a... | java | private void completePendingFlush()
{
int size = _pendingFlushEntries.size();
if (size == 0) {
return;
}
// ArrayList<TableService.PageFlush> pageList = new ArrayList<>();
for (int i = 0; i < size; i++) {
PendingEntry entry = _pendingFlushEntries.get(i);
entry.a... | [
"private",
"void",
"completePendingFlush",
"(",
")",
"{",
"int",
"size",
"=",
"_pendingFlushEntries",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"return",
";",
"}",
"// ArrayList<TableService.PageFlush> pageList = new ArrayList<>();",
"for... | Notifies the calling service after the entry is written to the mmap.
The entries will be added to the pending sync list. | [
"Notifies",
"the",
"calling",
"service",
"after",
"the",
"entry",
"is",
"written",
"to",
"the",
"mmap",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java#L424-L445 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java | OutSegment.fsyncImpl | private void fsyncImpl(Result<Boolean> result, FsyncType fsyncType)
{
try {
flushData();
ArrayList<SegmentFsyncCallback> fsyncListeners
= new ArrayList<>(_fsyncListeners);
_fsyncListeners.clear();
Result<Boolean> resultNext = result.then((v,r)->
afterDataFsync... | java | private void fsyncImpl(Result<Boolean> result, FsyncType fsyncType)
{
try {
flushData();
ArrayList<SegmentFsyncCallback> fsyncListeners
= new ArrayList<>(_fsyncListeners);
_fsyncListeners.clear();
Result<Boolean> resultNext = result.then((v,r)->
afterDataFsync... | [
"private",
"void",
"fsyncImpl",
"(",
"Result",
"<",
"Boolean",
">",
"result",
",",
"FsyncType",
"fsyncType",
")",
"{",
"try",
"{",
"flushData",
"(",
")",
";",
"ArrayList",
"<",
"SegmentFsyncCallback",
">",
"fsyncListeners",
"=",
"new",
"ArrayList",
"<>",
"("... | Syncs the segment to the disk. After the segment's data is synced, the
headers can be written. A second sync is needed to complete the header
writes. | [
"Syncs",
"the",
"segment",
"to",
"the",
"disk",
".",
"After",
"the",
"segment",
"s",
"data",
"is",
"synced",
"the",
"headers",
"can",
"be",
"written",
".",
"A",
"second",
"sync",
"is",
"needed",
"to",
"complete",
"the",
"header",
"writes",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java#L476-L507 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java | OutSegment.afterDataFsync | private void afterDataFsync(Result<Boolean> result,
int position,
FsyncType fsyncType,
ArrayList<SegmentFsyncCallback> listeners)
{
try {
completeIndex(position);
Result<Boolean> cont = result.then((v,r)->... | java | private void afterDataFsync(Result<Boolean> result,
int position,
FsyncType fsyncType,
ArrayList<SegmentFsyncCallback> listeners)
{
try {
completeIndex(position);
Result<Boolean> cont = result.then((v,r)->... | [
"private",
"void",
"afterDataFsync",
"(",
"Result",
"<",
"Boolean",
">",
"result",
",",
"int",
"position",
",",
"FsyncType",
"fsyncType",
",",
"ArrayList",
"<",
"SegmentFsyncCallback",
">",
"listeners",
")",
"{",
"try",
"{",
"completeIndex",
"(",
"position",
"... | Callback after the page data has been fynced, so the index can be
written.
The page write is split in two, so the index is always written after
the data is guaranteed to be flushed to disk. | [
"Callback",
"after",
"the",
"page",
"data",
"has",
"been",
"fynced",
"so",
"the",
"index",
"can",
"be",
"written",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java#L516-L537 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java | OutSegment.afterIndexFsync | private void afterIndexFsync(Result<Boolean> result,
FsyncType fsyncType,
ArrayList<SegmentFsyncCallback> fsyncListeners)
{
try {
// completePendingEntries(_position);
if (fsyncType.isClose()) {
_isClosed = true;
_segment.fi... | java | private void afterIndexFsync(Result<Boolean> result,
FsyncType fsyncType,
ArrayList<SegmentFsyncCallback> fsyncListeners)
{
try {
// completePendingEntries(_position);
if (fsyncType.isClose()) {
_isClosed = true;
_segment.fi... | [
"private",
"void",
"afterIndexFsync",
"(",
"Result",
"<",
"Boolean",
">",
"result",
",",
"FsyncType",
"fsyncType",
",",
"ArrayList",
"<",
"SegmentFsyncCallback",
">",
"fsyncListeners",
")",
"{",
"try",
"{",
"// completePendingEntries(_position);",
"if",
"(",
"fsyncT... | Callback after the index has been flushed. | [
"Callback",
"after",
"the",
"index",
"has",
"been",
"flushed",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java#L542-L570 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java | OutSegment.writeIndex | private void writeIndex(int entryAddress,
byte []entryBuffer, int offset, int length)
{
long address = _segment.getAddress() + entryAddress;
if (_segment.length() < entryAddress + length) {
throw new IllegalStateException(L.l("offset=0x{0} length={1}", entryAddress, length));
... | java | private void writeIndex(int entryAddress,
byte []entryBuffer, int offset, int length)
{
long address = _segment.getAddress() + entryAddress;
if (_segment.length() < entryAddress + length) {
throw new IllegalStateException(L.l("offset=0x{0} length={1}", entryAddress, length));
... | [
"private",
"void",
"writeIndex",
"(",
"int",
"entryAddress",
",",
"byte",
"[",
"]",
"entryBuffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"long",
"address",
"=",
"_segment",
".",
"getAddress",
"(",
")",
"+",
"entryAddress",
";",
"if",
"(",... | Write the current header to the output. | [
"Write",
"the",
"current",
"header",
"to",
"the",
"output",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/segment/OutSegment.java#L687-L700 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/vault/ClassGeneratorVault.java | ClassGeneratorVault.createImpl | private static Constructor<?> createImpl(Class<?> cl,
ClassLoader loader)
{
/**
if (! Modifier.isAbstract(cl.getModifiers())) {
throw new IllegalArgumentException();
}
*/
ClassGeneratorVault<?> generator
= new ClassGeneratorVault<>(cl, lo... | java | private static Constructor<?> createImpl(Class<?> cl,
ClassLoader loader)
{
/**
if (! Modifier.isAbstract(cl.getModifiers())) {
throw new IllegalArgumentException();
}
*/
ClassGeneratorVault<?> generator
= new ClassGeneratorVault<>(cl, lo... | [
"private",
"static",
"Constructor",
"<",
"?",
">",
"createImpl",
"(",
"Class",
"<",
"?",
">",
"cl",
",",
"ClassLoader",
"loader",
")",
"{",
"/**\n if (! Modifier.isAbstract(cl.getModifiers())) {\n throw new IllegalArgumentException();\n }\n */",
"ClassGeneratorVau... | Must return Constructor, not MethodHandle because MethodHandles
cache the type in the permgen. | [
"Must",
"return",
"Constructor",
"not",
"MethodHandle",
"because",
"MethodHandles",
"cache",
"the",
"type",
"in",
"the",
"permgen",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/vault/ClassGeneratorVault.java#L160-L175 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/vault/ClassGeneratorVault.java | ClassGeneratorVault.introspectMethods | private void introspectMethods(JavaClass jClass)
{
for (Method method : getMethods()) {
Class<?> []paramTypes = method.getParameterTypes();
int paramLen = paramTypes.length;
if (! Modifier.isAbstract(method.getModifiers())) {
continue;
}
if (Modifier.isStatic(method.g... | java | private void introspectMethods(JavaClass jClass)
{
for (Method method : getMethods()) {
Class<?> []paramTypes = method.getParameterTypes();
int paramLen = paramTypes.length;
if (! Modifier.isAbstract(method.getModifiers())) {
continue;
}
if (Modifier.isStatic(method.g... | [
"private",
"void",
"introspectMethods",
"(",
"JavaClass",
"jClass",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"getMethods",
"(",
")",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"paramTypes",
"=",
"method",
".",
"getParameterTypes",
"(",
")",
";",
... | Introspect the methods to find abstract methods. | [
"Introspect",
"the",
"methods",
"to",
"find",
"abstract",
"methods",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/vault/ClassGeneratorVault.java#L363-L440 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java | CompilingLoader.create | public static DynamicClassLoader create(PathImpl path)
{
DynamicClassLoader loader = new DynamicClassLoader(null);
CompilingLoader compilingLoader = new CompilingLoader(loader, path);
compilingLoader.init();
loader.init();
return loader;
} | java | public static DynamicClassLoader create(PathImpl path)
{
DynamicClassLoader loader = new DynamicClassLoader(null);
CompilingLoader compilingLoader = new CompilingLoader(loader, path);
compilingLoader.init();
loader.init();
return loader;
} | [
"public",
"static",
"DynamicClassLoader",
"create",
"(",
"PathImpl",
"path",
")",
"{",
"DynamicClassLoader",
"loader",
"=",
"new",
"DynamicClassLoader",
"(",
"null",
")",
";",
"CompilingLoader",
"compilingLoader",
"=",
"new",
"CompilingLoader",
"(",
"loader",
",",
... | Create a class loader based on the compiling loader
@param path traditional classpath
@return the new ClassLoader | [
"Create",
"a",
"class",
"loader",
"based",
"on",
"the",
"compiling",
"loader"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java#L160-L170 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java | CompilingLoader.create | public static DynamicClassLoader create(ClassLoader parent,
PathImpl classDir, PathImpl sourceDir,
String args, String encoding)
{
DynamicClassLoader loader = new DynamicClassLoader(parent);
loader.addLoader(new CompilingLoade... | java | public static DynamicClassLoader create(ClassLoader parent,
PathImpl classDir, PathImpl sourceDir,
String args, String encoding)
{
DynamicClassLoader loader = new DynamicClassLoader(parent);
loader.addLoader(new CompilingLoade... | [
"public",
"static",
"DynamicClassLoader",
"create",
"(",
"ClassLoader",
"parent",
",",
"PathImpl",
"classDir",
",",
"PathImpl",
"sourceDir",
",",
"String",
"args",
",",
"String",
"encoding",
")",
"{",
"DynamicClassLoader",
"loader",
"=",
"new",
"DynamicClassLoader",... | Creates a new compiling class loader
@param classDir generated class directory root
@param sourceDir Java source directory root
@param args Javac arguments
@param encoding javac encoding | [
"Creates",
"a",
"new",
"compiling",
"class",
"loader"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java#L180-L190 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java | CompilingLoader.make | @Override
public void make()
{
synchronized (this) {
if (CurrentTime.currentTime() < _lastMakeTime + 2000)
return;
try {
makeImpl();
} catch (Exception e) {
log.log(Level.FINER, e.toString(), e);
}
_lastMakeTime = CurrentTime.currentTime();
}
} | java | @Override
public void make()
{
synchronized (this) {
if (CurrentTime.currentTime() < _lastMakeTime + 2000)
return;
try {
makeImpl();
} catch (Exception e) {
log.log(Level.FINER, e.toString(), e);
}
_lastMakeTime = CurrentTime.currentTime();
}
} | [
"@",
"Override",
"public",
"void",
"make",
"(",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"CurrentTime",
".",
"currentTime",
"(",
")",
"<",
"_lastMakeTime",
"+",
"2000",
")",
"return",
";",
"try",
"{",
"makeImpl",
"(",
")",
";",
"}"... | Compiles all changed files in the class directory. | [
"Compiles",
"all",
"changed",
"files",
"in",
"the",
"class",
"directory",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java#L380-L395 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java | CompilingLoader.findAllModifiedClasses | private void findAllModifiedClasses(String name,
PathImpl sourceDir,
PathImpl classDir,
String sourcePath,
ArrayList<String> sources)
throws IOException, ClassNotFo... | java | private void findAllModifiedClasses(String name,
PathImpl sourceDir,
PathImpl classDir,
String sourcePath,
ArrayList<String> sources)
throws IOException, ClassNotFo... | [
"private",
"void",
"findAllModifiedClasses",
"(",
"String",
"name",
",",
"PathImpl",
"sourceDir",
",",
"PathImpl",
"classDir",
",",
"String",
"sourcePath",
",",
"ArrayList",
"<",
"String",
">",
"sources",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
... | Returns the classes which need compilation. | [
"Returns",
"the",
"classes",
"which",
"need",
"compilation",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java#L430-L511 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java | CompilingLoader.getClassEntry | @Override
protected ClassEntry getClassEntry(String name, String pathName)
throws ClassNotFoundException
{
PathImpl classFile = _classDir.lookup(pathName);
/*
Path classDir = classFile.getParent();
if (! classDir.isDirectory())
return null;
*/
String javaName = name.repla... | java | @Override
protected ClassEntry getClassEntry(String name, String pathName)
throws ClassNotFoundException
{
PathImpl classFile = _classDir.lookup(pathName);
/*
Path classDir = classFile.getParent();
if (! classDir.isDirectory())
return null;
*/
String javaName = name.repla... | [
"@",
"Override",
"protected",
"ClassEntry",
"getClassEntry",
"(",
"String",
"name",
",",
"String",
"pathName",
")",
"throws",
"ClassNotFoundException",
"{",
"PathImpl",
"classFile",
"=",
"_classDir",
".",
"lookup",
"(",
"pathName",
")",
";",
"/*\n Path classDir =... | Loads the specified class, compiling if necessary. | [
"Loads",
"the",
"specified",
"class",
"compiling",
"if",
"necessary",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java#L516-L569 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java | CompilingLoader.checkSource | boolean checkSource(PathImpl sourceDir, String javaName)
{
try {
while (javaName != null && ! javaName.equals("")) {
int p = javaName.indexOf('/');
String head;
if (p >= 0) {
head = javaName.substring(0, p);
javaName = javaName.substring(p + 1);
}
... | java | boolean checkSource(PathImpl sourceDir, String javaName)
{
try {
while (javaName != null && ! javaName.equals("")) {
int p = javaName.indexOf('/');
String head;
if (p >= 0) {
head = javaName.substring(0, p);
javaName = javaName.substring(p + 1);
}
... | [
"boolean",
"checkSource",
"(",
"PathImpl",
"sourceDir",
",",
"String",
"javaName",
")",
"{",
"try",
"{",
"while",
"(",
"javaName",
"!=",
"null",
"&&",
"!",
"javaName",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"int",
"p",
"=",
"javaName",
".",
"indexO... | Checks that the case is okay for the source. | [
"Checks",
"that",
"the",
"case",
"is",
"okay",
"for",
"the",
"source",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java#L584-L619 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java | CompilingLoader.getPath | @Override
public PathImpl getPath(String name)
{
PathImpl path = _classDir.lookup(name);
if (path != null && path.exists())
return path;
path = _sourceDir.lookup(name);
if (path != null && path.exists())
return path;
return null;
} | java | @Override
public PathImpl getPath(String name)
{
PathImpl path = _classDir.lookup(name);
if (path != null && path.exists())
return path;
path = _sourceDir.lookup(name);
if (path != null && path.exists())
return path;
return null;
} | [
"@",
"Override",
"public",
"PathImpl",
"getPath",
"(",
"String",
"name",
")",
"{",
"PathImpl",
"path",
"=",
"_classDir",
".",
"lookup",
"(",
"name",
")",
";",
"if",
"(",
"path",
"!=",
"null",
"&&",
"path",
".",
"exists",
"(",
")",
")",
"return",
"pat... | Returns the path for the given name.
@param name the name of the class | [
"Returns",
"the",
"path",
"for",
"the",
"given",
"name",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java#L715-L729 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java | CompilingLoader.buildClassPath | @Override
protected void buildClassPath(ArrayList<String> pathList)
{
if (! _classDir.getScheme().equals("file"))
return;
try {
if (! _classDir.isDirectory() && _sourceDir.isDirectory()) {
try {
_classDir.mkdirs();
} catch (IOException e) {
}
}
if ... | java | @Override
protected void buildClassPath(ArrayList<String> pathList)
{
if (! _classDir.getScheme().equals("file"))
return;
try {
if (! _classDir.isDirectory() && _sourceDir.isDirectory()) {
try {
_classDir.mkdirs();
} catch (IOException e) {
}
}
if ... | [
"@",
"Override",
"protected",
"void",
"buildClassPath",
"(",
"ArrayList",
"<",
"String",
">",
"pathList",
")",
"{",
"if",
"(",
"!",
"_classDir",
".",
"getScheme",
"(",
")",
".",
"equals",
"(",
"\"file\"",
")",
")",
"return",
";",
"try",
"{",
"if",
"(",... | Adds the classpath we're responsible for to the classpath
@param head the overriding classpath
@return the new classpath | [
"Adds",
"the",
"classpath",
"we",
"re",
"responsible",
"for",
"to",
"the",
"classpath"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/loader/CompilingLoader.java#L745-L775 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/web/webapp/RequestBaratineImpl.java | RequestBaratineImpl.session | @Override
public ServiceRefAmp session(String name)
{
String address = "session:///" + name + "/";
return sessionImpl(address);
} | java | @Override
public ServiceRefAmp session(String name)
{
String address = "session:///" + name + "/";
return sessionImpl(address);
} | [
"@",
"Override",
"public",
"ServiceRefAmp",
"session",
"(",
"String",
"name",
")",
"{",
"String",
"address",
"=",
"\"session:///\"",
"+",
"name",
"+",
"\"/\"",
";",
"return",
"sessionImpl",
"(",
"address",
")",
";",
"}"
] | Find the session by its service name.
If the session doesn't exist, create it. | [
"Find",
"the",
"session",
"by",
"its",
"service",
"name",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/web/webapp/RequestBaratineImpl.java#L257-L263 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/web/webapp/RequestBaratineImpl.java | RequestBaratineImpl.session | @Override
public <X> X session(Class<X> type)
{
String address = services().address(type);
if (address.startsWith("/")) {
address = "session://" + address;
}
return sessionImpl(address + "/").as(type);
} | java | @Override
public <X> X session(Class<X> type)
{
String address = services().address(type);
if (address.startsWith("/")) {
address = "session://" + address;
}
return sessionImpl(address + "/").as(type);
} | [
"@",
"Override",
"public",
"<",
"X",
">",
"X",
"session",
"(",
"Class",
"<",
"X",
">",
"type",
")",
"{",
"String",
"address",
"=",
"services",
"(",
")",
".",
"address",
"(",
"type",
")",
";",
"if",
"(",
"address",
".",
"startsWith",
"(",
"\"/\"",
... | Find the session by its service type.
If the session doesn't exist, create it. | [
"Find",
"the",
"session",
"by",
"its",
"service",
"type",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/web/webapp/RequestBaratineImpl.java#L270-L280 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/web/webapp/RequestBaratineImpl.java | RequestBaratineImpl.sessionImpl | private ServiceRefAmp sessionImpl(String address)
{
if (! address.startsWith("session:") || ! address.endsWith("/")) {
throw new IllegalArgumentException(address);
}
String sessionId = cookie("JSESSIONID");
if (sessionId == null) {
sessionId = generateSessionId();
cookie("JSESSION... | java | private ServiceRefAmp sessionImpl(String address)
{
if (! address.startsWith("session:") || ! address.endsWith("/")) {
throw new IllegalArgumentException(address);
}
String sessionId = cookie("JSESSIONID");
if (sessionId == null) {
sessionId = generateSessionId();
cookie("JSESSION... | [
"private",
"ServiceRefAmp",
"sessionImpl",
"(",
"String",
"address",
")",
"{",
"if",
"(",
"!",
"address",
".",
"startsWith",
"(",
"\"session:\"",
")",
"||",
"!",
"address",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | Find or create a session cookie as the session id and
find or create a session with the generated address. | [
"Find",
"or",
"create",
"a",
"session",
"cookie",
"as",
"the",
"session",
"id",
"and",
"find",
"or",
"create",
"a",
"session",
"with",
"the",
"generated",
"address",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/web/webapp/RequestBaratineImpl.java#L286-L301 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/web/webapp/RequestBaratineImpl.java | RequestBaratineImpl.upgrade | @Override
public void upgrade(Object protocol)
{
Objects.requireNonNull(protocol);
if (protocol instanceof ServiceWebSocket) {
ServiceWebSocket<?,?> webSocket = (ServiceWebSocket<?,?>) protocol;
upgradeWebSocket(webSocket);
}
else {
throw new IllegalArgumentException(protocol.toS... | java | @Override
public void upgrade(Object protocol)
{
Objects.requireNonNull(protocol);
if (protocol instanceof ServiceWebSocket) {
ServiceWebSocket<?,?> webSocket = (ServiceWebSocket<?,?>) protocol;
upgradeWebSocket(webSocket);
}
else {
throw new IllegalArgumentException(protocol.toS... | [
"@",
"Override",
"public",
"void",
"upgrade",
"(",
"Object",
"protocol",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"protocol",
")",
";",
"if",
"(",
"protocol",
"instanceof",
"ServiceWebSocket",
")",
"{",
"ServiceWebSocket",
"<",
"?",
",",
"?",
">",
... | Starts an upgrade of the HTTP request to a protocol on raw TCP. | [
"Starts",
"an",
"upgrade",
"of",
"the",
"HTTP",
"request",
"to",
"a",
"protocol",
"on",
"raw",
"TCP",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/web/webapp/RequestBaratineImpl.java#L363-L376 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/bytecode/JClassWrapper.java | JClassWrapper.getMethods | public JMethod []getMethods()
{
Method []methods = _class.getMethods();
JMethod []jMethods = new JMethod[methods.length];
for (int i = 0; i < methods.length; i++) {
jMethods[i] = new JMethodWrapper(methods[i], getClassLoader());
}
return jMethods;
} | java | public JMethod []getMethods()
{
Method []methods = _class.getMethods();
JMethod []jMethods = new JMethod[methods.length];
for (int i = 0; i < methods.length; i++) {
jMethods[i] = new JMethodWrapper(methods[i], getClassLoader());
}
return jMethods;
} | [
"public",
"JMethod",
"[",
"]",
"getMethods",
"(",
")",
"{",
"Method",
"[",
"]",
"methods",
"=",
"_class",
".",
"getMethods",
"(",
")",
";",
"JMethod",
"[",
"]",
"jMethods",
"=",
"new",
"JMethod",
"[",
"methods",
".",
"length",
"]",
";",
"for",
"(",
... | Returns the public methods. | [
"Returns",
"the",
"public",
"methods",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/JClassWrapper.java#L241-L252 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/bytecode/JClassWrapper.java | JClassWrapper.getMethod | public JMethod getMethod(String name, JClass []types)
{
JClassLoader jClassLoader = getClassLoader();
return getMethod(_class, name, types, jClassLoader);
} | java | public JMethod getMethod(String name, JClass []types)
{
JClassLoader jClassLoader = getClassLoader();
return getMethod(_class, name, types, jClassLoader);
} | [
"public",
"JMethod",
"getMethod",
"(",
"String",
"name",
",",
"JClass",
"[",
"]",
"types",
")",
"{",
"JClassLoader",
"jClassLoader",
"=",
"getClassLoader",
"(",
")",
";",
"return",
"getMethod",
"(",
"_class",
",",
"name",
",",
"types",
",",
"jClassLoader",
... | Returns the matching methods. | [
"Returns",
"the",
"matching",
"methods",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/JClassWrapper.java#L257-L262 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/bytecode/JClassWrapper.java | JClassWrapper.getConstructors | public JMethod []getConstructors()
{
Constructor []methods = _class.getConstructors();
JMethod []jMethods = new JMethod[methods.length];
for (int i = 0; i < methods.length; i++) {
jMethods[i] = new JConstructorWrapper(methods[i], getClassLoader());
}
return jMethods;
} | java | public JMethod []getConstructors()
{
Constructor []methods = _class.getConstructors();
JMethod []jMethods = new JMethod[methods.length];
for (int i = 0; i < methods.length; i++) {
jMethods[i] = new JConstructorWrapper(methods[i], getClassLoader());
}
return jMethods;
} | [
"public",
"JMethod",
"[",
"]",
"getConstructors",
"(",
")",
"{",
"Constructor",
"[",
"]",
"methods",
"=",
"_class",
".",
"getConstructors",
"(",
")",
";",
"JMethod",
"[",
"]",
"jMethods",
"=",
"new",
"JMethod",
"[",
"methods",
".",
"length",
"]",
";",
... | Returns the public constructors. | [
"Returns",
"the",
"public",
"constructors",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/JClassWrapper.java#L300-L311 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/h3/io/InRawH3Impl.java | InRawH3Impl.scan | @Override
public void scan(InH3Amp in, PathH3Amp path, Object[] values)
{
int ch = read();
switch (ch) {
case 0xd0:
readDefinition(in);
scan(in, path, values);
return;
case 0xd1: case 0xd2: case 0xd3:
case 0xd4: case 0xd5: case 0xd6: case 0xd7:
case 0xd8: case ... | java | @Override
public void scan(InH3Amp in, PathH3Amp path, Object[] values)
{
int ch = read();
switch (ch) {
case 0xd0:
readDefinition(in);
scan(in, path, values);
return;
case 0xd1: case 0xd2: case 0xd3:
case 0xd4: case 0xd5: case 0xd6: case 0xd7:
case 0xd8: case ... | [
"@",
"Override",
"public",
"void",
"scan",
"(",
"InH3Amp",
"in",
",",
"PathH3Amp",
"path",
",",
"Object",
"[",
"]",
"values",
")",
"{",
"int",
"ch",
"=",
"read",
"(",
")",
";",
"switch",
"(",
"ch",
")",
"{",
"case",
"0xd0",
":",
"readDefinition",
"... | Scan for a query. | [
"Scan",
"for",
"a",
"query",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/h3/io/InRawH3Impl.java#L415-L452 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.setParent | @Override
public void setParent(Logger parent)
{
if (parent.equals(_parent))
return;
super.setParent(parent);
if (parent instanceof EnvironmentLogger) {
_parent = (EnvironmentLogger) parent;
_parent.addChild(this);
}
updateEffectiveLevel(_systemClassLoader);
} | java | @Override
public void setParent(Logger parent)
{
if (parent.equals(_parent))
return;
super.setParent(parent);
if (parent instanceof EnvironmentLogger) {
_parent = (EnvironmentLogger) parent;
_parent.addChild(this);
}
updateEffectiveLevel(_systemClassLoader);
} | [
"@",
"Override",
"public",
"void",
"setParent",
"(",
"Logger",
"parent",
")",
"{",
"if",
"(",
"parent",
".",
"equals",
"(",
"_parent",
")",
")",
"return",
";",
"super",
".",
"setParent",
"(",
"parent",
")",
";",
"if",
"(",
"parent",
"instanceof",
"Envi... | Sets the logger's parent. This should only be called by the LogManager
code. | [
"Sets",
"the",
"logger",
"s",
"parent",
".",
"This",
"should",
"only",
"be",
"called",
"by",
"the",
"LogManager",
"code",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L104-L119 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.getLevel | @Override
public Level getLevel()
{
if (_localLevel != null) {
Level level = _localLevel.get();
if (level != null) {
return level;
}
}
return _systemLevel;
} | java | @Override
public Level getLevel()
{
if (_localLevel != null) {
Level level = _localLevel.get();
if (level != null) {
return level;
}
}
return _systemLevel;
} | [
"@",
"Override",
"public",
"Level",
"getLevel",
"(",
")",
"{",
"if",
"(",
"_localLevel",
"!=",
"null",
")",
"{",
"Level",
"level",
"=",
"_localLevel",
".",
"get",
"(",
")",
";",
"if",
"(",
"level",
"!=",
"null",
")",
"{",
"return",
"level",
";",
"}... | Returns the logger's assigned level. | [
"Returns",
"the",
"logger",
"s",
"assigned",
"level",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L128-L140 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.setLevel | @Override
public void setLevel(Level level)
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null) {
loader = _systemClassLoader;
}
if (loader != _systemClassLoader) {
if (_localLevel == null)
_localLevel = new EnvironmentLocal<Level>();
... | java | @Override
public void setLevel(Level level)
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null) {
loader = _systemClassLoader;
}
if (loader != _systemClassLoader) {
if (_localLevel == null)
_localLevel = new EnvironmentLocal<Level>();
... | [
"@",
"Override",
"public",
"void",
"setLevel",
"(",
"Level",
"level",
")",
"{",
"ClassLoader",
"loader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"if",
"(",
"loader",
"==",
"null",
")",
"{",
"loader",
"=... | Application API to set the level.
@param level the logging level to set for the logger. | [
"Application",
"API",
"to",
"set",
"the",
"level",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L147-L171 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.getHandlers | @Override
public Handler []getHandlers()
{
Handler []handlers = _localHandlers.get();
if (handlers != null)
return handlers;
else
return EMPTY_HANDLERS;
} | java | @Override
public Handler []getHandlers()
{
Handler []handlers = _localHandlers.get();
if (handlers != null)
return handlers;
else
return EMPTY_HANDLERS;
} | [
"@",
"Override",
"public",
"Handler",
"[",
"]",
"getHandlers",
"(",
")",
"{",
"Handler",
"[",
"]",
"handlers",
"=",
"_localHandlers",
".",
"get",
"(",
")",
";",
"if",
"(",
"handlers",
"!=",
"null",
")",
"return",
"handlers",
";",
"else",
"return",
"EMP... | Returns the handlers. | [
"Returns",
"the",
"handlers",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L180-L189 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.removeHandler | @Override
public void removeHandler(Handler handler)
{
synchronized (this) {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null) {
loader = _systemClassLoader;
}
for (int i = _loaders.size() - 1; i >= 0; i--) {
WeakReference<Cl... | java | @Override
public void removeHandler(Handler handler)
{
synchronized (this) {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null) {
loader = _systemClassLoader;
}
for (int i = _loaders.size() - 1; i >= 0; i--) {
WeakReference<Cl... | [
"@",
"Override",
"public",
"void",
"removeHandler",
"(",
"Handler",
"handler",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"ClassLoader",
"loader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"if",
"(",
... | Removes a handler. | [
"Removes",
"a",
"handler",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L238-L265 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.isLoggable | @Override
public final boolean isLoggable(Level level)
{
if (level == null)
return false;
int intValue = level.intValue();
if (intValue < _finestEffectiveLevelValue)
return false;
else if (! _hasLocalEffectiveLevel) {
return true;
}
else {
Integer localValue = _... | java | @Override
public final boolean isLoggable(Level level)
{
if (level == null)
return false;
int intValue = level.intValue();
if (intValue < _finestEffectiveLevelValue)
return false;
else if (! _hasLocalEffectiveLevel) {
return true;
}
else {
Integer localValue = _... | [
"@",
"Override",
"public",
"final",
"boolean",
"isLoggable",
"(",
"Level",
"level",
")",
"{",
"if",
"(",
"level",
"==",
"null",
")",
"return",
"false",
";",
"int",
"intValue",
"=",
"level",
".",
"intValue",
"(",
")",
";",
"if",
"(",
"intValue",
"<",
... | True if the level is loggable | [
"True",
"if",
"the",
"level",
"is",
"loggable"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L274-L305 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.getUseParentHandlers | @Override
public boolean getUseParentHandlers()
{
Boolean value = _useParentHandlers.get();
if (value != null)
return Boolean.TRUE.equals(value);
else
return true;
} | java | @Override
public boolean getUseParentHandlers()
{
Boolean value = _useParentHandlers.get();
if (value != null)
return Boolean.TRUE.equals(value);
else
return true;
} | [
"@",
"Override",
"public",
"boolean",
"getUseParentHandlers",
"(",
")",
"{",
"Boolean",
"value",
"=",
"_useParentHandlers",
".",
"get",
"(",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"return",
"Boolean",
".",
"TRUE",
".",
"equals",
"(",
"value",
"... | Returns the use-parent-handlers | [
"Returns",
"the",
"use",
"-",
"parent",
"-",
"handlers"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L310-L319 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.log | @Override
public void log(LogRecord record)
{
if (record == null)
return;
Level recordLevel = record.getLevel();
if (! isLoggable(recordLevel))
return;
for (Logger ptr = this; ptr != null; ptr = ptr.getParent()) {
Handler handlers[] = ptr.getHandlers();
if (handle... | java | @Override
public void log(LogRecord record)
{
if (record == null)
return;
Level recordLevel = record.getLevel();
if (! isLoggable(recordLevel))
return;
for (Logger ptr = this; ptr != null; ptr = ptr.getParent()) {
Handler handlers[] = ptr.getHandlers();
if (handle... | [
"@",
"Override",
"public",
"void",
"log",
"(",
"LogRecord",
"record",
")",
"{",
"if",
"(",
"record",
"==",
"null",
")",
"return",
";",
"Level",
"recordLevel",
"=",
"record",
".",
"getLevel",
"(",
")",
";",
"if",
"(",
"!",
"isLoggable",
"(",
"recordLeve... | Logs the message. | [
"Logs",
"the",
"message",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L333-L356 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.addHandler | private void addHandler(Handler handler, ClassLoader loader)
{
// handlers ordered by level
ArrayList<Handler> handlers = new ArrayList<Handler>();
handlers.add(handler);
for (ClassLoader ptr = loader; ptr != null; ptr = ptr.getParent()) {
Handler []localHandlers = _localHandlers.getLevel(ptr)... | java | private void addHandler(Handler handler, ClassLoader loader)
{
// handlers ordered by level
ArrayList<Handler> handlers = new ArrayList<Handler>();
handlers.add(handler);
for (ClassLoader ptr = loader; ptr != null; ptr = ptr.getParent()) {
Handler []localHandlers = _localHandlers.getLevel(ptr)... | [
"private",
"void",
"addHandler",
"(",
"Handler",
"handler",
",",
"ClassLoader",
"loader",
")",
"{",
"// handlers ordered by level",
"ArrayList",
"<",
"Handler",
">",
"handlers",
"=",
"new",
"ArrayList",
"<",
"Handler",
">",
"(",
")",
";",
"handlers",
".",
"add... | Adds a new handler with a given classloader context. | [
"Adds",
"a",
"new",
"handler",
"with",
"a",
"given",
"classloader",
"context",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L375-L411 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.isParentLoader | private boolean isParentLoader(ClassLoader parent, ClassLoader child)
{
for (; child != null; child = child.getParent()) {
if (child == parent)
return true;
}
return false;
} | java | private boolean isParentLoader(ClassLoader parent, ClassLoader child)
{
for (; child != null; child = child.getParent()) {
if (child == parent)
return true;
}
return false;
} | [
"private",
"boolean",
"isParentLoader",
"(",
"ClassLoader",
"parent",
",",
"ClassLoader",
"child",
")",
"{",
"for",
"(",
";",
"child",
"!=",
"null",
";",
"child",
"=",
"child",
".",
"getParent",
"(",
")",
")",
"{",
"if",
"(",
"child",
"==",
"parent",
"... | Returns true if 'parent' is a parent classloader of 'child'.
@param parent the classloader to test as a parent.
@param child the classloader to test as a child. | [
"Returns",
"true",
"if",
"parent",
"is",
"a",
"parent",
"classloader",
"of",
"child",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L453-L461 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.addCustomLogger | public boolean addCustomLogger(Logger logger)
{
if (logger.getClass().getName().startsWith("java"))
return false;
Logger oldLogger = _localLoggers.get();
if (oldLogger != null)
return false;
_localLoggers.set(logger);
if (_parent != null) {
logger.setParent(_parent);
... | java | public boolean addCustomLogger(Logger logger)
{
if (logger.getClass().getName().startsWith("java"))
return false;
Logger oldLogger = _localLoggers.get();
if (oldLogger != null)
return false;
_localLoggers.set(logger);
if (_parent != null) {
logger.setParent(_parent);
... | [
"public",
"boolean",
"addCustomLogger",
"(",
"Logger",
"logger",
")",
"{",
"if",
"(",
"logger",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
".",
"startsWith",
"(",
"\"java\"",
")",
")",
"return",
"false",
";",
"Logger",
"oldLogger",
"=",
"_local... | Sets a custom logger if possible | [
"Sets",
"a",
"custom",
"logger",
"if",
"possible"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L466-L483 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.addLoader | private void addLoader(ClassLoader loader)
{
for (int i = _loaders.size() - 1; i >= 0; i--) {
WeakReference<ClassLoader> ref = _loaders.get(i);
ClassLoader refLoader = ref.get();
if (refLoader == null)
_loaders.remove(i);
if (refLoader == loader)
return;
}
_loade... | java | private void addLoader(ClassLoader loader)
{
for (int i = _loaders.size() - 1; i >= 0; i--) {
WeakReference<ClassLoader> ref = _loaders.get(i);
ClassLoader refLoader = ref.get();
if (refLoader == null)
_loaders.remove(i);
if (refLoader == loader)
return;
}
_loade... | [
"private",
"void",
"addLoader",
"(",
"ClassLoader",
"loader",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"_loaders",
".",
"size",
"(",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"WeakReference",
"<",
"ClassLoader",
">",
"ref",
"=",
... | Adds a class loader to the list of dependency loaders. | [
"Adds",
"a",
"class",
"loader",
"to",
"the",
"list",
"of",
"dependency",
"loaders",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L496-L511 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.updateEffectiveLevel | private synchronized void updateEffectiveLevel(ClassLoader loader)
{
if (loader == null)
loader = _systemClassLoader;
int oldEffectiveLevel = getEffectiveLevel(loader);
Level newEffectiveLevel = calculateEffectiveLevel(loader);
/*
if (loader == _systemClassLoader) {
_finestEffec... | java | private synchronized void updateEffectiveLevel(ClassLoader loader)
{
if (loader == null)
loader = _systemClassLoader;
int oldEffectiveLevel = getEffectiveLevel(loader);
Level newEffectiveLevel = calculateEffectiveLevel(loader);
/*
if (loader == _systemClassLoader) {
_finestEffec... | [
"private",
"synchronized",
"void",
"updateEffectiveLevel",
"(",
"ClassLoader",
"loader",
")",
"{",
"if",
"(",
"loader",
"==",
"null",
")",
"loader",
"=",
"_systemClassLoader",
";",
"int",
"oldEffectiveLevel",
"=",
"getEffectiveLevel",
"(",
"loader",
")",
";",
"L... | Recalculate the dynamic assigned levels. | [
"Recalculate",
"the",
"dynamic",
"assigned",
"levels",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L534-L575 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.getFinestLevel | private Level getFinestLevel()
{
Level level;
if (_parent == null)
level = Level.INFO;
else if (_parent.isLocalLevel())
level = selectFinestLevel(_systemLevel, _parent.getFinestLevel());
else if (_systemLevel != null)
level = _systemLevel;
else
level = _parent.getFines... | java | private Level getFinestLevel()
{
Level level;
if (_parent == null)
level = Level.INFO;
else if (_parent.isLocalLevel())
level = selectFinestLevel(_systemLevel, _parent.getFinestLevel());
else if (_systemLevel != null)
level = _systemLevel;
else
level = _parent.getFines... | [
"private",
"Level",
"getFinestLevel",
"(",
")",
"{",
"Level",
"level",
";",
"if",
"(",
"_parent",
"==",
"null",
")",
"level",
"=",
"Level",
".",
"INFO",
";",
"else",
"if",
"(",
"_parent",
".",
"isLocalLevel",
"(",
")",
")",
"level",
"=",
"selectFinestL... | Returns the finest assigned level for any classloader environment. | [
"Returns",
"the",
"finest",
"assigned",
"level",
"for",
"any",
"classloader",
"environment",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L689-L716 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.selectFinestLevel | private Level selectFinestLevel(Level a, Level b)
{
if (a == null)
return b;
else if (b == null)
return a;
else if (b.intValue() < a.intValue())
return b;
else
return a;
} | java | private Level selectFinestLevel(Level a, Level b)
{
if (a == null)
return b;
else if (b == null)
return a;
else if (b.intValue() < a.intValue())
return b;
else
return a;
} | [
"private",
"Level",
"selectFinestLevel",
"(",
"Level",
"a",
",",
"Level",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"null",
")",
"return",
"b",
";",
"else",
"if",
"(",
"b",
"==",
"null",
")",
"return",
"a",
";",
"else",
"if",
"(",
"b",
".",
"intValue"... | Returns the finest of the two levels. | [
"Returns",
"the",
"finest",
"of",
"the",
"two",
"levels",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L731-L741 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.getAssignedLevel | private Level getAssignedLevel(ClassLoader loader)
{
Level level = null;
if (_localLevel != null) {
return _localLevel.get(loader);
}
return null;
} | java | private Level getAssignedLevel(ClassLoader loader)
{
Level level = null;
if (_localLevel != null) {
return _localLevel.get(loader);
}
return null;
} | [
"private",
"Level",
"getAssignedLevel",
"(",
"ClassLoader",
"loader",
")",
"{",
"Level",
"level",
"=",
"null",
";",
"if",
"(",
"_localLevel",
"!=",
"null",
")",
"{",
"return",
"_localLevel",
".",
"get",
"(",
"loader",
")",
";",
"}",
"return",
"null",
";"... | Returns the most specific assigned level for the given classloader, i.e.
children override parents. | [
"Returns",
"the",
"most",
"specific",
"assigned",
"level",
"for",
"the",
"given",
"classloader",
"i",
".",
"e",
".",
"children",
"override",
"parents",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L747-L756 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.removeLoader | private synchronized void removeLoader(ClassLoader loader)
{
int i;
for (i = _loaders.size() - 1; i >= 0; i--) {
WeakReference<ClassLoader> ref = _loaders.get(i);
ClassLoader refLoader = ref.get();
if (refLoader == null)
_loaders.remove(i);
else if (refLoader == loader)
... | java | private synchronized void removeLoader(ClassLoader loader)
{
int i;
for (i = _loaders.size() - 1; i >= 0; i--) {
WeakReference<ClassLoader> ref = _loaders.get(i);
ClassLoader refLoader = ref.get();
if (refLoader == null)
_loaders.remove(i);
else if (refLoader == loader)
... | [
"private",
"synchronized",
"void",
"removeLoader",
"(",
"ClassLoader",
"loader",
")",
"{",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"_loaders",
".",
"size",
"(",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"WeakReference",
"<",
"Cla... | Removes the specified loader. | [
"Removes",
"the",
"specified",
"loader",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L794-L806 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.classLoaderDestroy | @Override
public void classLoaderDestroy(DynamicClassLoader loader)
{
removeLoader(loader);
_localHandlers.remove(loader);
HandlerEntry ownHandlers = _ownHandlers.getLevel(loader);
if (ownHandlers != null)
_ownHandlers.remove(loader);
if (ownHandlers != null)
ownHandlers.destroy()... | java | @Override
public void classLoaderDestroy(DynamicClassLoader loader)
{
removeLoader(loader);
_localHandlers.remove(loader);
HandlerEntry ownHandlers = _ownHandlers.getLevel(loader);
if (ownHandlers != null)
_ownHandlers.remove(loader);
if (ownHandlers != null)
ownHandlers.destroy()... | [
"@",
"Override",
"public",
"void",
"classLoaderDestroy",
"(",
"DynamicClassLoader",
"loader",
")",
"{",
"removeLoader",
"(",
"loader",
")",
";",
"_localHandlers",
".",
"remove",
"(",
"loader",
")",
";",
"HandlerEntry",
"ownHandlers",
"=",
"_ownHandlers",
".",
"g... | Classloader destroy callback | [
"Classloader",
"destroy",
"callback"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L818-L836 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/TempCharReader.java | TempCharReader.init | public void init(TempCharBuffer head)
{
_top = head;
_head = head;
if (head != null) {
_buffer = head.buffer();
_length = head.getLength();
}
else
_length = 0;
_offset = 0;
} | java | public void init(TempCharBuffer head)
{
_top = head;
_head = head;
if (head != null) {
_buffer = head.buffer();
_length = head.getLength();
}
else
_length = 0;
_offset = 0;
} | [
"public",
"void",
"init",
"(",
"TempCharBuffer",
"head",
")",
"{",
"_top",
"=",
"head",
";",
"_head",
"=",
"head",
";",
"if",
"(",
"head",
"!=",
"null",
")",
"{",
"_buffer",
"=",
"head",
".",
"buffer",
"(",
")",
";",
"_length",
"=",
"head",
".",
... | Initialize the reader. | [
"Initialize",
"the",
"reader",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/TempCharReader.java#L70-L83 | train |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/TempCharReader.java | TempCharReader.close | public void close()
{
if (_isFree)
TempCharBuffer.freeAll(_head);
_head = null;
_buffer = null;
_offset = 0;
_length = 0;
} | java | public void close()
{
if (_isFree)
TempCharBuffer.freeAll(_head);
_head = null;
_buffer = null;
_offset = 0;
_length = 0;
} | [
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"_isFree",
")",
"TempCharBuffer",
".",
"freeAll",
"(",
"_head",
")",
";",
"_head",
"=",
"null",
";",
"_buffer",
"=",
"null",
";",
"_offset",
"=",
"0",
";",
"_length",
"=",
"0",
";",
"}"
] | Closes the reader. | [
"Closes",
"the",
"reader",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/TempCharReader.java#L176-L185 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/service/ValidatorVault.java | ValidatorVault.createValidation | private void createValidation(Class<?> vaultClass,
Class<?> assetClass,
Class<?> idClass)
{
for (Method method : vaultClass.getMethods()) {
if (! method.getName().startsWith("create")) {
continue;
}
if (! Modifier.is... | java | private void createValidation(Class<?> vaultClass,
Class<?> assetClass,
Class<?> idClass)
{
for (Method method : vaultClass.getMethods()) {
if (! method.getName().startsWith("create")) {
continue;
}
if (! Modifier.is... | [
"private",
"void",
"createValidation",
"(",
"Class",
"<",
"?",
">",
"vaultClass",
",",
"Class",
"<",
"?",
">",
"assetClass",
",",
"Class",
"<",
"?",
">",
"idClass",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"vaultClass",
".",
"getMethods",
"(",
")... | Validate the create methods. | [
"Validate",
"the",
"create",
"methods",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/service/ValidatorVault.java#L116-L157 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/service/ValidatorVault.java | ValidatorVault.findValidation | private void findValidation(Class<?> vaultClass,
Class<?> assetClass,
Class<?> idClass)
{
for (Method method : vaultClass.getMethods()) {
if (! method.getName().startsWith("find")) {
continue;
}
if (! Modifier.isAbst... | java | private void findValidation(Class<?> vaultClass,
Class<?> assetClass,
Class<?> idClass)
{
for (Method method : vaultClass.getMethods()) {
if (! method.getName().startsWith("find")) {
continue;
}
if (! Modifier.isAbst... | [
"private",
"void",
"findValidation",
"(",
"Class",
"<",
"?",
">",
"vaultClass",
",",
"Class",
"<",
"?",
">",
"assetClass",
",",
"Class",
"<",
"?",
">",
"idClass",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"vaultClass",
".",
"getMethods",
"(",
")",... | Validate the find methods. | [
"Validate",
"the",
"find",
"methods",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/service/ValidatorVault.java#L162-L202 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/deploy2/Strategy2StartManualRedeployManual.java | Strategy2StartManualRedeployManual.startOnInit | @Override
public void startOnInit(DeployService2Impl<I> deploy, Result<I> result)
{
deploy.startImpl(result);
} | java | @Override
public void startOnInit(DeployService2Impl<I> deploy, Result<I> result)
{
deploy.startImpl(result);
} | [
"@",
"Override",
"public",
"void",
"startOnInit",
"(",
"DeployService2Impl",
"<",
"I",
">",
"deploy",
",",
"Result",
"<",
"I",
">",
"result",
")",
"{",
"deploy",
".",
"startImpl",
"(",
"result",
")",
";",
"}"
] | Called at initialization time for automatic start.
@param deploy the owning controller | [
"Called",
"at",
"initialization",
"time",
"for",
"automatic",
"start",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/deploy2/Strategy2StartManualRedeployManual.java#L83-L87 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/deploy2/Strategy2StartManualRedeployManual.java | Strategy2StartManualRedeployManual.update | @Override
public void update(DeployService2Impl<I> deploy, Result<I> result)
{
LifecycleState state = deploy.getState();
if (state.isStopped()) {
deploy.startImpl(result);
}
else if (state.isError()) {
deploy.restartImpl(result);
}
else if (deploy.isModifiedNow()) {
de... | java | @Override
public void update(DeployService2Impl<I> deploy, Result<I> result)
{
LifecycleState state = deploy.getState();
if (state.isStopped()) {
deploy.startImpl(result);
}
else if (state.isError()) {
deploy.restartImpl(result);
}
else if (deploy.isModifiedNow()) {
de... | [
"@",
"Override",
"public",
"void",
"update",
"(",
"DeployService2Impl",
"<",
"I",
">",
"deploy",
",",
"Result",
"<",
"I",
">",
"result",
")",
"{",
"LifecycleState",
"state",
"=",
"deploy",
".",
"getState",
"(",
")",
";",
"if",
"(",
"state",
".",
"isSto... | Checks for updates from an admin command. The target state will be the
initial state, i.e. update will not start a lazy instance.
@param deploy the owning controller | [
"Checks",
"for",
"updates",
"from",
"an",
"admin",
"command",
".",
"The",
"target",
"state",
"will",
"be",
"the",
"initial",
"state",
"i",
".",
"e",
".",
"update",
"will",
"not",
"start",
"a",
"lazy",
"instance",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/deploy2/Strategy2StartManualRedeployManual.java#L95-L112 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/deploy2/Strategy2StartManualRedeployManual.java | Strategy2StartManualRedeployManual.request | @Override
public void request(DeployService2Impl<I> deploy,
Result<I> result)
{
result.ok(deploy.get());
} | java | @Override
public void request(DeployService2Impl<I> deploy,
Result<I> result)
{
result.ok(deploy.get());
} | [
"@",
"Override",
"public",
"void",
"request",
"(",
"DeployService2Impl",
"<",
"I",
">",
"deploy",
",",
"Result",
"<",
"I",
">",
"result",
")",
"{",
"result",
".",
"ok",
"(",
"deploy",
".",
"get",
"(",
")",
")",
";",
"}"
] | Returns the current instance. This strategy does not lazily restart
the instance.
@param deploy the owning controller
@return the current deploy instance | [
"Returns",
"the",
"current",
"instance",
".",
"This",
"strategy",
"does",
"not",
"lazily",
"restart",
"the",
"instance",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/deploy2/Strategy2StartManualRedeployManual.java#L122-L127 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/table/TableKraken.java | TableKraken.getPodHash | public static int getPodHash(String key)
{
byte []buffer = new byte[16];
int sublen = Math.min(key.length(), 8);
for (int i = 0; i < sublen; i++) {
buffer[i] = (byte) key.charAt(i);
}
long hash = Murmur64.generate(Murmur64.SEED, key);
BitsUtil.writeLong(buffer, 8, has... | java | public static int getPodHash(String key)
{
byte []buffer = new byte[16];
int sublen = Math.min(key.length(), 8);
for (int i = 0; i < sublen; i++) {
buffer[i] = (byte) key.charAt(i);
}
long hash = Murmur64.generate(Murmur64.SEED, key);
BitsUtil.writeLong(buffer, 8, has... | [
"public",
"static",
"int",
"getPodHash",
"(",
"String",
"key",
")",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"16",
"]",
";",
"int",
"sublen",
"=",
"Math",
".",
"min",
"(",
"key",
".",
"length",
"(",
")",
",",
"8",
")",
";",
"fo... | Convenience for calculating the pod hash for a string. | [
"Convenience",
"for",
"calculating",
"the",
"pod",
"hash",
"for",
"a",
"string",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/table/TableKraken.java#L215-L230 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/table/TableKraken.java | TableKraken.get | public void get(RowCursor cursor, Result<Boolean> result)
{
TablePod tablePod = getTablePod();
int hash = getPodHash(cursor);
if (tablePod.getNode(hash).isSelfCopy()) {
_tableKelp.getDirect(cursor, result);
}
else {
getTablePod().get(cursor.getKey(),
r... | java | public void get(RowCursor cursor, Result<Boolean> result)
{
TablePod tablePod = getTablePod();
int hash = getPodHash(cursor);
if (tablePod.getNode(hash).isSelfCopy()) {
_tableKelp.getDirect(cursor, result);
}
else {
getTablePod().get(cursor.getKey(),
r... | [
"public",
"void",
"get",
"(",
"RowCursor",
"cursor",
",",
"Result",
"<",
"Boolean",
">",
"result",
")",
"{",
"TablePod",
"tablePod",
"=",
"getTablePod",
"(",
")",
";",
"int",
"hash",
"=",
"getPodHash",
"(",
"cursor",
")",
";",
"if",
"(",
"tablePod",
".... | Gets a row from the table when the primary key is known.
@param cursor the request cursor containing the key
@param result return true when the row exists. | [
"Gets",
"a",
"row",
"from",
"the",
"table",
"when",
"the",
"primary",
"key",
"is",
"known",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/table/TableKraken.java#L420-L433 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/http/protocol/InContentLength.java | InContentLength.read | @Override
public int read(byte []buffer, int offset, int length)
throws IOException
{
try {
if (_length < length)
length = (int) _length;
if (length <= 0)
return -1;
int len = _next.read(buffer, offset, length);
if (len > 0) {
_length -= len;
}
else {
... | java | @Override
public int read(byte []buffer, int offset, int length)
throws IOException
{
try {
if (_length < length)
length = (int) _length;
if (length <= 0)
return -1;
int len = _next.read(buffer, offset, length);
if (len > 0) {
_length -= len;
}
else {
... | [
"@",
"Override",
"public",
"int",
"read",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"_length",
"<",
"length",
")",
"length",
"=",
"(",
"int",
")",
"_length",... | Reads from the buffer, limiting to the content length.
@param buffer the buffer containing the results.
@param offset the offset into the result buffer
@param length the length of the buffer.
@return the number of bytes read or -1 for the end of the file. | [
"Reads",
"from",
"the",
"buffer",
"limiting",
"to",
"the",
"content",
"length",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/InContentLength.java#L92-L116 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/log/PatternFormatter.java | PatternFormatter.format | @Override
public String format(LogRecord log)
{
StringBuilder sb = new StringBuilder();
int mark = 0;
for (FormatItem item : _formatList) {
item.format(sb, log, mark);
if (item instanceof PrettyPrintMarkItem) {
mark = sb.length();
}
}
return sb.toStrin... | java | @Override
public String format(LogRecord log)
{
StringBuilder sb = new StringBuilder();
int mark = 0;
for (FormatItem item : _formatList) {
item.format(sb, log, mark);
if (item instanceof PrettyPrintMarkItem) {
mark = sb.length();
}
}
return sb.toStrin... | [
"@",
"Override",
"public",
"String",
"format",
"(",
"LogRecord",
"log",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"mark",
"=",
"0",
";",
"for",
"(",
"FormatItem",
"item",
":",
"_formatList",
")",
"{",
"item",
"... | Formats the record | [
"Formats",
"the",
"record"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/PatternFormatter.java#L105-L121 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/stream/StreamBuilderImpl.java | StreamBuilderImpl.reduce | @Override
public StreamBuilderImpl<T,U> reduce(T init,
BinaryOperatorSync<T> op)
{
return new ReduceOpInitSync<>(this, init, op);
} | java | @Override
public StreamBuilderImpl<T,U> reduce(T init,
BinaryOperatorSync<T> op)
{
return new ReduceOpInitSync<>(this, init, op);
} | [
"@",
"Override",
"public",
"StreamBuilderImpl",
"<",
"T",
",",
"U",
">",
"reduce",
"(",
"T",
"init",
",",
"BinaryOperatorSync",
"<",
"T",
">",
"op",
")",
"{",
"return",
"new",
"ReduceOpInitSync",
"<>",
"(",
"this",
",",
"init",
",",
"op",
")",
";",
"... | Reduce with a binary function
<code><pre>
s = init;
s = op(s, t1);
s = op(s, t2);
result = s;
</pre></code> | [
"Reduce",
"with",
"a",
"binary",
"function"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/stream/StreamBuilderImpl.java#L214-L219 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/stream/StreamBuilderImpl.java | StreamBuilderImpl.reduce | @Override
public <R> StreamBuilderImpl<R,U>
reduce(R identity,
BiFunctionSync<R, ? super T, R> accumulator,
BinaryOperatorSync<R> combiner)
{
return new ReduceAccumSync<>(this, identity, accumulator, combiner);
} | java | @Override
public <R> StreamBuilderImpl<R,U>
reduce(R identity,
BiFunctionSync<R, ? super T, R> accumulator,
BinaryOperatorSync<R> combiner)
{
return new ReduceAccumSync<>(this, identity, accumulator, combiner);
} | [
"@",
"Override",
"public",
"<",
"R",
">",
"StreamBuilderImpl",
"<",
"R",
",",
"U",
">",
"reduce",
"(",
"R",
"identity",
",",
"BiFunctionSync",
"<",
"R",
",",
"?",
"super",
"T",
",",
"R",
">",
"accumulator",
",",
"BinaryOperatorSync",
"<",
"R",
">",
"... | Reduce with an accumulator and combiner | [
"Reduce",
"with",
"an",
"accumulator",
"and",
"combiner"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/stream/StreamBuilderImpl.java#L240-L247 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/loader/DependencyContainer.java | DependencyContainer.setModified | public void setModified(boolean isModified)
{
_isModified = isModified;
if (_isModified)
_checkExpiresTime = Long.MAX_VALUE / 2;
else
_checkExpiresTime = CurrentTime.currentTime() + _checkInterval;
if (! isModified)
_isModifiedLog = false;
} | java | public void setModified(boolean isModified)
{
_isModified = isModified;
if (_isModified)
_checkExpiresTime = Long.MAX_VALUE / 2;
else
_checkExpiresTime = CurrentTime.currentTime() + _checkInterval;
if (! isModified)
_isModifiedLog = false;
} | [
"public",
"void",
"setModified",
"(",
"boolean",
"isModified",
")",
"{",
"_isModified",
"=",
"isModified",
";",
"if",
"(",
"_isModified",
")",
"_checkExpiresTime",
"=",
"Long",
".",
"MAX_VALUE",
"/",
"2",
";",
"else",
"_checkExpiresTime",
"=",
"CurrentTime",
"... | Sets the modified. | [
"Sets",
"the",
"modified",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/loader/DependencyContainer.java#L195-L206 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/web/builder/IncludeWebClass.java | IncludeWebClass.buildWebService | private static ServiceWeb
buildWebService(WebBuilder builder,
Function<RequestWeb,Object> beanFactory,
Method method)
{
Parameter []params = method.getParameters();
WebParam []webParam = new WebParam[params.length];
for (int i = 0; i < params.length; i++) {
we... | java | private static ServiceWeb
buildWebService(WebBuilder builder,
Function<RequestWeb,Object> beanFactory,
Method method)
{
Parameter []params = method.getParameters();
WebParam []webParam = new WebParam[params.length];
for (int i = 0; i < params.length; i++) {
we... | [
"private",
"static",
"ServiceWeb",
"buildWebService",
"(",
"WebBuilder",
"builder",
",",
"Function",
"<",
"RequestWeb",
",",
"Object",
">",
"beanFactory",
",",
"Method",
"method",
")",
"{",
"Parameter",
"[",
"]",
"params",
"=",
"method",
".",
"getParameters",
... | Builds a HTTP service from a method.
<pre><code>
@Get
void myMethod(&64;Query("id") id, Result<String> result);
</code></pre>
Method parameters are filled from the request.
@param builder called to create the service
@param beanFactory factory for the bean instance
@param method method for the service | [
"Builds",
"a",
"HTTP",
"service",
"from",
"a",
"method",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/web/builder/IncludeWebClass.java#L402-L416 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/MultipartStream.java | MultipartStream.getAttribute | public String getAttribute(String key)
{
List<String> values = _headers.get(key.toLowerCase(Locale.ENGLISH));
if (values != null && values.size() > 0)
return values.get(0);
return null;
} | java | public String getAttribute(String key)
{
List<String> values = _headers.get(key.toLowerCase(Locale.ENGLISH));
if (values != null && values.size() > 0)
return values.get(0);
return null;
} | [
"public",
"String",
"getAttribute",
"(",
"String",
"key",
")",
"{",
"List",
"<",
"String",
">",
"values",
"=",
"_headers",
".",
"get",
"(",
"key",
".",
"toLowerCase",
"(",
"Locale",
".",
"ENGLISH",
")",
")",
";",
"if",
"(",
"values",
"!=",
"null",
"&... | Returns a read attribute from the multipart mime. | [
"Returns",
"a",
"read",
"attribute",
"from",
"the",
"multipart",
"mime",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/MultipartStream.java#L196-L204 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/MultipartStream.java | MultipartStream.getAvailable | public int getAvailable()
throws IOException
{
if (_isPartDone)
return 0;
else if (_peekOffset < _peekLength)
return _peekLength - _peekOffset;
else {
int ch = read();
if (ch < 0)
return 0;
_peekOffset = 0;
_peekLength = 1;
_peek[0] = (byte) ch;
... | java | public int getAvailable()
throws IOException
{
if (_isPartDone)
return 0;
else if (_peekOffset < _peekLength)
return _peekLength - _peekOffset;
else {
int ch = read();
if (ch < 0)
return 0;
_peekOffset = 0;
_peekLength = 1;
_peek[0] = (byte) ch;
... | [
"public",
"int",
"getAvailable",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_isPartDone",
")",
"return",
"0",
";",
"else",
"if",
"(",
"_peekOffset",
"<",
"_peekLength",
")",
"return",
"_peekLength",
"-",
"_peekOffset",
";",
"else",
"{",
"int",
"ch... | Returns the number of available bytes. | [
"Returns",
"the",
"number",
"of",
"available",
"bytes",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/MultipartStream.java#L291-L308 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/io/MultipartStream.java | MultipartStream.read | @Override
public int read(byte[] buffer, int offset, int length) throws IOException
{
int b = -1;
if (_isPartDone)
return -1;
int i = 0;
// Need the last peek or would miss the initial '\n'
while (_peekOffset + 1 < _peekLength && length > 0) {
buffer[offset + i++] = _peek[_peekOffs... | java | @Override
public int read(byte[] buffer, int offset, int length) throws IOException
{
int b = -1;
if (_isPartDone)
return -1;
int i = 0;
// Need the last peek or would miss the initial '\n'
while (_peekOffset + 1 < _peekLength && length > 0) {
buffer[offset + i++] = _peek[_peekOffs... | [
"@",
"Override",
"public",
"int",
"read",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"int",
"b",
"=",
"-",
"1",
";",
"if",
"(",
"_isPartDone",
")",
"return",
"-",
"1",
";",
"int",... | Reads from the multipart mime buffer. | [
"Reads",
"from",
"the",
"multipart",
"mime",
"buffer",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/io/MultipartStream.java#L313-L408 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/service/ServiceBuilderImpl.java | ServiceBuilderImpl.ref | @Override
public ServiceRefAmp ref()
{
if (_isForeign) {
return null;
}
if (workers() > 1) {
return buildWorkers();
}
if (_worker != null) {
return buildWorker();
}
else {
//throw new IllegalStateException(L.l("build() requires a worker or resource."));
... | java | @Override
public ServiceRefAmp ref()
{
if (_isForeign) {
return null;
}
if (workers() > 1) {
return buildWorkers();
}
if (_worker != null) {
return buildWorker();
}
else {
//throw new IllegalStateException(L.l("build() requires a worker or resource."));
... | [
"@",
"Override",
"public",
"ServiceRefAmp",
"ref",
"(",
")",
"{",
"if",
"(",
"_isForeign",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"workers",
"(",
")",
">",
"1",
")",
"{",
"return",
"buildWorkers",
"(",
")",
";",
"}",
"if",
"(",
"_worker",... | Build the service and return the service ref. | [
"Build",
"the",
"service",
"and",
"return",
"the",
"service",
"ref",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/service/ServiceBuilderImpl.java#L758-L776 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/service/ServiceBuilderImpl.java | ServiceBuilderImpl.service | private ServiceRefAmp service(StubFactoryAmp stubFactory)
{
validateOpen();
Thread thread = Thread.currentThread();
ClassLoader oldLoader = thread.getContextClassLoader();
OutboxAmp outbox = OutboxAmp.current();
Object oldContext = null;
try {
thread.setContextClassLoader(_serv... | java | private ServiceRefAmp service(StubFactoryAmp stubFactory)
{
validateOpen();
Thread thread = Thread.currentThread();
ClassLoader oldLoader = thread.getContextClassLoader();
OutboxAmp outbox = OutboxAmp.current();
Object oldContext = null;
try {
thread.setContextClassLoader(_serv... | [
"private",
"ServiceRefAmp",
"service",
"(",
"StubFactoryAmp",
"stubFactory",
")",
"{",
"validateOpen",
"(",
")",
";",
"Thread",
"thread",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"ClassLoader",
"oldLoader",
"=",
"thread",
".",
"getContextClassLoader",
... | Main service builder. Called from ServiceBuilder and ServiceRefBean. | [
"Main",
"service",
"builder",
".",
"Called",
"from",
"ServiceBuilder",
"and",
"ServiceRefBean",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/service/ServiceBuilderImpl.java#L943-L981 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/amp/service/ServiceBuilderImpl.java | ServiceBuilderImpl.service | ServiceRefAmp service(QueueServiceFactoryInbox serviceFactory,
ServiceConfig config)
{
QueueDeliverBuilderImpl<MessageAmp> queueBuilder
= new QueueDeliverBuilderImpl<>();
//queueBuilder.setOutboxFactory(OutboxAmpFactory.newFactory());
queueBuilder.setClassLoader(_service... | java | ServiceRefAmp service(QueueServiceFactoryInbox serviceFactory,
ServiceConfig config)
{
QueueDeliverBuilderImpl<MessageAmp> queueBuilder
= new QueueDeliverBuilderImpl<>();
//queueBuilder.setOutboxFactory(OutboxAmpFactory.newFactory());
queueBuilder.setClassLoader(_service... | [
"ServiceRefAmp",
"service",
"(",
"QueueServiceFactoryInbox",
"serviceFactory",
",",
"ServiceConfig",
"config",
")",
"{",
"QueueDeliverBuilderImpl",
"<",
"MessageAmp",
">",
"queueBuilder",
"=",
"new",
"QueueDeliverBuilderImpl",
"<>",
"(",
")",
";",
"//queueBuilder.setOutbo... | Used by journal builder. | [
"Used",
"by",
"journal",
"builder",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/service/ServiceBuilderImpl.java#L1101-L1119 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parse | public QueryBuilderKraken parse()
{
Token token = scanToken();
switch (token) {
case CREATE:
return parseCreate();
case EXPLAIN:
return parseExplain();
case INSERT:
return parseInsert();
case REPLACE:
return parseReplace();
case SELECT:
return... | java | public QueryBuilderKraken parse()
{
Token token = scanToken();
switch (token) {
case CREATE:
return parseCreate();
case EXPLAIN:
return parseExplain();
case INSERT:
return parseInsert();
case REPLACE:
return parseReplace();
case SELECT:
return... | [
"public",
"QueryBuilderKraken",
"parse",
"(",
")",
"{",
"Token",
"token",
"=",
"scanToken",
"(",
")",
";",
"switch",
"(",
"token",
")",
"{",
"case",
"CREATE",
":",
"return",
"parseCreate",
"(",
")",
";",
"case",
"EXPLAIN",
":",
"return",
"parseExplain",
... | Parses the query. | [
"Parses",
"the",
"query",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L163-L222 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseSelectExpr | private ExprKraken parseSelectExpr()
{
Token token = scanToken();
if (token == Token.STAR) {
// return new UnboundStarExpr();
throw new UnsupportedOperationException(getClass().getName());
}
else {
_token = token;
return parseExpr();
}
} | java | private ExprKraken parseSelectExpr()
{
Token token = scanToken();
if (token == Token.STAR) {
// return new UnboundStarExpr();
throw new UnsupportedOperationException(getClass().getName());
}
else {
_token = token;
return parseExpr();
}
} | [
"private",
"ExprKraken",
"parseSelectExpr",
"(",
")",
"{",
"Token",
"token",
"=",
"scanToken",
"(",
")",
";",
"if",
"(",
"token",
"==",
"Token",
".",
"STAR",
")",
"{",
"// return new UnboundStarExpr();",
"throw",
"new",
"UnsupportedOperationException",
"(",
"get... | Parses a select expression. | [
"Parses",
"a",
"select",
"expression",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L792-L806 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseCreate | private QueryBuilderKraken parseCreate()
{
Token token;
// TableBuilderKraken factory = null;// = _database.createTableFactory();
if ((token = scanToken()) != Token.TABLE)
throw error("expected TABLE at '{0}'", token);
if ((token = scanToken()) != Token.IDENTIFIER)
throw error("expected... | java | private QueryBuilderKraken parseCreate()
{
Token token;
// TableBuilderKraken factory = null;// = _database.createTableFactory();
if ((token = scanToken()) != Token.TABLE)
throw error("expected TABLE at '{0}'", token);
if ((token = scanToken()) != Token.IDENTIFIER)
throw error("expected... | [
"private",
"QueryBuilderKraken",
"parseCreate",
"(",
")",
"{",
"Token",
"token",
";",
"// TableBuilderKraken factory = null;// = _database.createTableFactory();",
"if",
"(",
"(",
"token",
"=",
"scanToken",
"(",
")",
")",
"!=",
"Token",
".",
"TABLE",
")",
"throw",
"e... | Parses the create. | [
"Parses",
"the",
"create",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L984-L1108 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseReferences | public void parseReferences(ArrayList<String> name)
{
String foreignTable = parseIdentifier();
Token token = scanToken();
ArrayList<String> foreignColumns = new ArrayList<String>();
if (token == Token.LPAREN) {
_token = token;
foreignColumns = parseColumnNames();
}
else {
... | java | public void parseReferences(ArrayList<String> name)
{
String foreignTable = parseIdentifier();
Token token = scanToken();
ArrayList<String> foreignColumns = new ArrayList<String>();
if (token == Token.LPAREN) {
_token = token;
foreignColumns = parseColumnNames();
}
else {
... | [
"public",
"void",
"parseReferences",
"(",
"ArrayList",
"<",
"String",
">",
"name",
")",
"{",
"String",
"foreignTable",
"=",
"parseIdentifier",
"(",
")",
";",
"Token",
"token",
"=",
"scanToken",
"(",
")",
";",
"ArrayList",
"<",
"String",
">",
"foreignColumns"... | Parses the references clause. | [
"Parses",
"the",
"references",
"clause",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L1411-L1427 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseColumnNames | public ArrayList<String> parseColumnNames()
{
ArrayList<String> columns = new ArrayList<String>();
Token token = scanToken();
if (token == Token.LPAREN) {
do {
columns.add(parseIdentifier());
token = scanToken();
} while (token == Token.COMMA);
if (token != Token.RPARE... | java | public ArrayList<String> parseColumnNames()
{
ArrayList<String> columns = new ArrayList<String>();
Token token = scanToken();
if (token == Token.LPAREN) {
do {
columns.add(parseIdentifier());
token = scanToken();
} while (token == Token.COMMA);
if (token != Token.RPARE... | [
"public",
"ArrayList",
"<",
"String",
">",
"parseColumnNames",
"(",
")",
"{",
"ArrayList",
"<",
"String",
">",
"columns",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Token",
"token",
"=",
"scanToken",
"(",
")",
";",
"if",
"(",
"token",... | Parses a list of column names | [
"Parses",
"a",
"list",
"of",
"column",
"names"
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L1432-L1458 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseInsert | private QueryBuilderKraken parseInsert()
{
Token token;
if ((token = scanToken()) != Token.INTO) {
throw error("expected INTO at '{0}'", token);
}
TableKraken table = parseTable();
Objects.requireNonNull(table);
TableKelp tableKelp = table.getTableKelp();
ArrayList<Column> c... | java | private QueryBuilderKraken parseInsert()
{
Token token;
if ((token = scanToken()) != Token.INTO) {
throw error("expected INTO at '{0}'", token);
}
TableKraken table = parseTable();
Objects.requireNonNull(table);
TableKelp tableKelp = table.getTableKelp();
ArrayList<Column> c... | [
"private",
"QueryBuilderKraken",
"parseInsert",
"(",
")",
"{",
"Token",
"token",
";",
"if",
"(",
"(",
"token",
"=",
"scanToken",
"(",
")",
")",
"!=",
"Token",
".",
"INTO",
")",
"{",
"throw",
"error",
"(",
"\"expected INTO at '{0}'\"",
",",
"token",
")",
... | Parses the insert. | [
"Parses",
"the",
"insert",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L1463-L1548 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseUpdate | private QueryBuilderKraken parseUpdate()
{
Token token;
UpdateQueryBuilder query = new UpdateQueryBuilder(_tableManager, _sql);
String tableName = parseTableName();
query.setTableName(tableName);
_query = query;
if ((token = scanToken()) != Token.SET) {
throw error(L.l("expe... | java | private QueryBuilderKraken parseUpdate()
{
Token token;
UpdateQueryBuilder query = new UpdateQueryBuilder(_tableManager, _sql);
String tableName = parseTableName();
query.setTableName(tableName);
_query = query;
if ((token = scanToken()) != Token.SET) {
throw error(L.l("expe... | [
"private",
"QueryBuilderKraken",
"parseUpdate",
"(",
")",
"{",
"Token",
"token",
";",
"UpdateQueryBuilder",
"query",
"=",
"new",
"UpdateQueryBuilder",
"(",
"_tableManager",
",",
"_sql",
")",
";",
"String",
"tableName",
"=",
"parseTableName",
"(",
")",
";",
"quer... | Parses the update.
UPDATE table_name SET a=?,b=? WHERE expr | [
"Parses",
"the",
"update",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L1852-L1893 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseSetItem | private void parseSetItem(UpdateQueryBuilder query)
{
Token token;
if ((token = scanToken()) != Token.IDENTIFIER) {
throw error(L.l("expected identifier at '{0}'", token));
}
String columnName = _lexeme;
if ((token = scanToken()) != Token.EQ) {
throw error("expected '=' at {0}", tok... | java | private void parseSetItem(UpdateQueryBuilder query)
{
Token token;
if ((token = scanToken()) != Token.IDENTIFIER) {
throw error(L.l("expected identifier at '{0}'", token));
}
String columnName = _lexeme;
if ((token = scanToken()) != Token.EQ) {
throw error("expected '=' at {0}", tok... | [
"private",
"void",
"parseSetItem",
"(",
"UpdateQueryBuilder",
"query",
")",
"{",
"Token",
"token",
";",
"if",
"(",
"(",
"token",
"=",
"scanToken",
"(",
")",
")",
"!=",
"Token",
".",
"IDENTIFIER",
")",
"{",
"throw",
"error",
"(",
"L",
".",
"l",
"(",
"... | Parses a set item. | [
"Parses",
"a",
"set",
"item",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L1917-L1934 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseAndExpr | private ExprKraken parseAndExpr()
{
// AndExpr oldAndExpr = _andExpr;
AndExpr andExpr = new AndExpr();
// _andExpr = andExpr;
andExpr.add(parseNotExpr());
while (true) {
Token token = scanToken();
switch (token) {
case AND:
andExpr.add(parseNotExpr());
break;
... | java | private ExprKraken parseAndExpr()
{
// AndExpr oldAndExpr = _andExpr;
AndExpr andExpr = new AndExpr();
// _andExpr = andExpr;
andExpr.add(parseNotExpr());
while (true) {
Token token = scanToken();
switch (token) {
case AND:
andExpr.add(parseNotExpr());
break;
... | [
"private",
"ExprKraken",
"parseAndExpr",
"(",
")",
"{",
"// AndExpr oldAndExpr = _andExpr;",
"AndExpr",
"andExpr",
"=",
"new",
"AndExpr",
"(",
")",
";",
"// _andExpr = andExpr;",
"andExpr",
".",
"add",
"(",
"parseNotExpr",
"(",
")",
")",
";",
"while",
"(",
"true... | Parses an AND expression. | [
"Parses",
"an",
"AND",
"expression",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L1970-L1994 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseCmpExpr | private ExprKraken parseCmpExpr()
{
// Expr left = parseConcatExpr();
ExprKraken left = parseAddExpr();
Token token = scanToken();
boolean isNot = false;
/*
if (token == NOT) {
isNot = true;
token = scanToken();
if (token != BETWEEN && token != LIKE && token != ... | java | private ExprKraken parseCmpExpr()
{
// Expr left = parseConcatExpr();
ExprKraken left = parseAddExpr();
Token token = scanToken();
boolean isNot = false;
/*
if (token == NOT) {
isNot = true;
token = scanToken();
if (token != BETWEEN && token != LIKE && token != ... | [
"private",
"ExprKraken",
"parseCmpExpr",
"(",
")",
"{",
"// Expr left = parseConcatExpr();",
"ExprKraken",
"left",
"=",
"parseAddExpr",
"(",
")",
";",
"Token",
"token",
"=",
"scanToken",
"(",
")",
";",
"boolean",
"isNot",
"=",
"false",
";",
"/*\n\n if (token ==... | Parses a CMP expression. | [
"Parses",
"a",
"CMP",
"expression",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L2024-L2136 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseSimpleTerm | private ExprKraken parseSimpleTerm()
{
Token token = scanToken();
switch (token) {
case MINUS:
return new UnaryExpr(UnaryOp.MINUS, parseSimpleTerm());
case LPAREN:
{
ExprKraken expr = parseExpr();
if ((token = scanToken()) != Token.RPAREN) {
throw error("Ex... | java | private ExprKraken parseSimpleTerm()
{
Token token = scanToken();
switch (token) {
case MINUS:
return new UnaryExpr(UnaryOp.MINUS, parseSimpleTerm());
case LPAREN:
{
ExprKraken expr = parseExpr();
if ((token = scanToken()) != Token.RPAREN) {
throw error("Ex... | [
"private",
"ExprKraken",
"parseSimpleTerm",
"(",
")",
"{",
"Token",
"token",
"=",
"scanToken",
"(",
")",
";",
"switch",
"(",
"token",
")",
"{",
"case",
"MINUS",
":",
"return",
"new",
"UnaryExpr",
"(",
"UnaryOp",
".",
"MINUS",
",",
"parseSimpleTerm",
"(",
... | Parses a simple term. | [
"Parses",
"a",
"simple",
"term",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L2279-L2406 | train |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java | QueryParserKraken.parseIdentifier | private String parseIdentifier()
{
Token token = scanToken();
if (token != Token.IDENTIFIER) {
throw error("expected identifier at {0}", token);
}
return _lexeme;
} | java | private String parseIdentifier()
{
Token token = scanToken();
if (token != Token.IDENTIFIER) {
throw error("expected identifier at {0}", token);
}
return _lexeme;
} | [
"private",
"String",
"parseIdentifier",
"(",
")",
"{",
"Token",
"token",
"=",
"scanToken",
"(",
")",
";",
"if",
"(",
"token",
"!=",
"Token",
".",
"IDENTIFIER",
")",
"{",
"throw",
"error",
"(",
"\"expected identifier at {0}\"",
",",
"token",
")",
";",
"}",
... | Parses an identifier. | [
"Parses",
"an",
"identifier",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/QueryParserKraken.java#L2437-L2446 | train |
baratine/baratine | web/src/main/java/com/caucho/v5/deploy2/DeployHandle2Base.java | DeployHandle2Base.get | @Override
public I get()
{
I instance = _instance;
if (instance == null || instance.isModified()) {
_instance = instance = service().get();
}
return instance;
} | java | @Override
public I get()
{
I instance = _instance;
if (instance == null || instance.isModified()) {
_instance = instance = service().get();
}
return instance;
} | [
"@",
"Override",
"public",
"I",
"get",
"(",
")",
"{",
"I",
"instance",
"=",
"_instance",
";",
"if",
"(",
"instance",
"==",
"null",
"||",
"instance",
".",
"isModified",
"(",
")",
")",
"{",
"_instance",
"=",
"instance",
"=",
"service",
"(",
")",
".",
... | Returns the current instance. | [
"Returns",
"the",
"current",
"instance",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/deploy2/DeployHandle2Base.java#L95-L105 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/util/TimedCache.java | TimedCache.put | public V put(K key, V value)
{
Entry<V> oldValue = _cache.put(key, new Entry<V>(_expireInterval, value));
if (oldValue != null)
return oldValue.getValue();
else
return null;
} | java | public V put(K key, V value)
{
Entry<V> oldValue = _cache.put(key, new Entry<V>(_expireInterval, value));
if (oldValue != null)
return oldValue.getValue();
else
return null;
} | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"Entry",
"<",
"V",
">",
"oldValue",
"=",
"_cache",
".",
"put",
"(",
"key",
",",
"new",
"Entry",
"<",
"V",
">",
"(",
"_expireInterval",
",",
"value",
")",
")",
";",
"if",
"(",
... | Put a new item in the cache. | [
"Put",
"a",
"new",
"item",
"in",
"the",
"cache",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/TimedCache.java#L71-L79 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/util/TimedCache.java | TimedCache.get | public V get(K key)
{
Entry<V> entry = _cache.get(key);
if (entry == null)
return null;
if (entry.isValid())
return entry.getValue();
else {
_cache.remove(key);
return null;
}
} | java | public V get(K key)
{
Entry<V> entry = _cache.get(key);
if (entry == null)
return null;
if (entry.isValid())
return entry.getValue();
else {
_cache.remove(key);
return null;
}
} | [
"public",
"V",
"get",
"(",
"K",
"key",
")",
"{",
"Entry",
"<",
"V",
">",
"entry",
"=",
"_cache",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"entry",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"entry",
".",
"isValid",
"(",
")",
")"... | Gets an item from the cache, returning null if expired. | [
"Gets",
"an",
"item",
"from",
"the",
"cache",
"returning",
"null",
"if",
"expired",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/TimedCache.java#L84-L98 | train |
baratine/baratine | core/src/main/java/com/caucho/v5/bytecode/ByteCodeClassScanner.java | ByteCodeClassScanner.parseUtf8 | private int parseUtf8(InputStream is, int length)
throws IOException
{
if (length <= 0)
return 0;
if (length > 256) {
is.skip(length);
return 0;
}
int offset = _charBufferOffset;
if (_charBuffer.length <= offset + length) {
char []buffer = new char[2 * _c... | java | private int parseUtf8(InputStream is, int length)
throws IOException
{
if (length <= 0)
return 0;
if (length > 256) {
is.skip(length);
return 0;
}
int offset = _charBufferOffset;
if (_charBuffer.length <= offset + length) {
char []buffer = new char[2 * _c... | [
"private",
"int",
"parseUtf8",
"(",
"InputStream",
"is",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"if",
"(",
"length",
"<=",
"0",
")",
"return",
"0",
";",
"if",
"(",
"length",
">",
"256",
")",
"{",
"is",
".",
"skip",
"(",
"length",
... | Parses the UTF. | [
"Parses",
"the",
"UTF",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/ByteCodeClassScanner.java#L307-L379 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.