id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
43,600
ckpoint/CheckPoint
src/main/java/hsim/checkpoint/core/component/ComponentMap.java
ComponentMap.get
public synchronized static <T> T get(Class<T> cType) { if( map.get(cType) != null){ return cType.cast(map.get(cType)); } try { Object obj = cType.newInstance(); log.debug("[CREATE INSTANCE] : " + cType.getSimpleName()); map.put(cType, obj); ...
java
public synchronized static <T> T get(Class<T> cType) { if( map.get(cType) != null){ return cType.cast(map.get(cType)); } try { Object obj = cType.newInstance(); log.debug("[CREATE INSTANCE] : " + cType.getSimpleName()); map.put(cType, obj); ...
[ "public", "synchronized", "static", "<", "T", ">", "T", "get", "(", "Class", "<", "T", ">", "cType", ")", "{", "if", "(", "map", ".", "get", "(", "cType", ")", "!=", "null", ")", "{", "return", "cType", ".", "cast", "(", "map", ".", "get", "(",...
Get t. @param <T> the type parameter @param cType the c type @return the t
[ "Get", "t", "." ]
2c2b1a87a88485d49ea6afa34acdf16ef4134f19
https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/component/ComponentMap.java#L23-L38
43,601
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/VfsStringWriter.java
VfsStringWriter.openWrite
public WriteStreamOld openWrite() { if (_cb != null) _cb.clear(); else _cb = CharBuffer.allocate(); if (_ws == null) _ws = new WriteStreamOld(this); else _ws.init(this); try { _ws.setEncoding("utf-8"); } catch (UnsupportedEncodingException e) { } return...
java
public WriteStreamOld openWrite() { if (_cb != null) _cb.clear(); else _cb = CharBuffer.allocate(); if (_ws == null) _ws = new WriteStreamOld(this); else _ws.init(this); try { _ws.setEncoding("utf-8"); } catch (UnsupportedEncodingException e) { } return...
[ "public", "WriteStreamOld", "openWrite", "(", ")", "{", "if", "(", "_cb", "!=", "null", ")", "_cb", ".", "clear", "(", ")", ";", "else", "_cb", "=", "CharBuffer", ".", "allocate", "(", ")", ";", "if", "(", "_ws", "==", "null", ")", "_ws", "=", "n...
Opens a write stream using this StringWriter as the resulting string
[ "Opens", "a", "write", "stream", "using", "this", "StringWriter", "as", "the", "resulting", "string" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/VfsStringWriter.java#L55-L73
43,602
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/VfsStringWriter.java
VfsStringWriter.write
@Override public void write(byte []buf, int offset, int length, boolean isEnd) throws IOException { int end = offset + length; while (offset < end) { int ch1 = buf[offset++] & 0xff; if (ch1 < 0x80) _cb.append((char) ch1); else if ((ch1 & 0xe0) == 0xc0) { if (offset >= ...
java
@Override public void write(byte []buf, int offset, int length, boolean isEnd) throws IOException { int end = offset + length; while (offset < end) { int ch1 = buf[offset++] & 0xff; if (ch1 < 0x80) _cb.append((char) ch1); else if ((ch1 & 0xe0) == 0xc0) { if (offset >= ...
[ "@", "Override", "public", "void", "write", "(", "byte", "[", "]", "buf", ",", "int", "offset", ",", "int", "length", ",", "boolean", "isEnd", ")", "throws", "IOException", "{", "int", "end", "=", "offset", "+", "length", ";", "while", "(", "offset", ...
Writes a utf-8 encoded buffer to the underlying string. @param buf byte buffer containing the bytes @param offset offset where to start writing @param length number of bytes to write @param isEnd true when the write is flushing a close.
[ "Writes", "a", "utf", "-", "8", "encoded", "buffer", "to", "the", "underlying", "string", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/VfsStringWriter.java#L105-L144
43,603
SeaCloudsEU/SeaCloudsPlatform
deployer/src/main/java/eu/seaclouds/policy/SeaCloudsManagementPolicy.java
SeaCloudsManagementPolicy.extractMetricNames
public List<String> extractMetricNames() { List<String> result = new ArrayList<>(); for (MonitoringRule rule : monitoringRules.getMonitoringRules()) { for (Action action : rule.getActions().getActions()) { if (action.getName().equalsIgnoreCase("OutputMetric")) { ...
java
public List<String> extractMetricNames() { List<String> result = new ArrayList<>(); for (MonitoringRule rule : monitoringRules.getMonitoringRules()) { for (Action action : rule.getActions().getActions()) { if (action.getName().equalsIgnoreCase("OutputMetric")) { ...
[ "public", "List", "<", "String", ">", "extractMetricNames", "(", ")", "{", "List", "<", "String", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "MonitoringRule", "rule", ":", "monitoringRules", ".", "getMonitoringRules", "(", ")"...
Helper method to extract metric names from Monitoring Rules
[ "Helper", "method", "to", "extract", "metric", "names", "from", "Monitoring", "Rules" ]
b199fe6de2c63b808cb248d3aca947d802375df8
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/deployer/src/main/java/eu/seaclouds/policy/SeaCloudsManagementPolicy.java#L153-L168
43,604
baratine/baratine
framework/src/main/java/com/caucho/v5/util/Html.java
Html.escapeHtml
public static String escapeHtml(String s) { if (s == null) return null; StringBuilder cb = new StringBuilder(); int lineCharacter = 0; boolean startsWithSpace = false; for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); lineCharacter++; if (ch == '<'...
java
public static String escapeHtml(String s) { if (s == null) return null; StringBuilder cb = new StringBuilder(); int lineCharacter = 0; boolean startsWithSpace = false; for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); lineCharacter++; if (ch == '<'...
[ "public", "static", "String", "escapeHtml", "(", "String", "s", ")", "{", "if", "(", "s", "==", "null", ")", "return", "null", ";", "StringBuilder", "cb", "=", "new", "StringBuilder", "(", ")", ";", "int", "lineCharacter", "=", "0", ";", "boolean", "st...
Escapes special symbols in a string. For example '<' becomes '&lt;'
[ "Escapes", "special", "symbols", "in", "a", "string", ".", "For", "example", "<", "becomes", "&lt", ";" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/Html.java#L40-L78
43,605
Dissem/Jabit
core/src/main/java/ch/dissem/bitmessage/utils/Bytes.java
Bytes.inc
public static void inc(byte[] nonce, byte value) { int i = nonce.length - 1; nonce[i] += value; if (value > 0 && (nonce[i] < 0 || nonce[i] >= value)) return; if (value < 0 && (nonce[i] < 0 && nonce[i] >= value)) return; for (i = i - 1; i >= 0; i--) { ...
java
public static void inc(byte[] nonce, byte value) { int i = nonce.length - 1; nonce[i] += value; if (value > 0 && (nonce[i] < 0 || nonce[i] >= value)) return; if (value < 0 && (nonce[i] < 0 && nonce[i] >= value)) return; for (i = i - 1; i >= 0; i--) { ...
[ "public", "static", "void", "inc", "(", "byte", "[", "]", "nonce", ",", "byte", "value", ")", "{", "int", "i", "=", "nonce", ".", "length", "-", "1", ";", "nonce", "[", "i", "]", "+=", "value", ";", "if", "(", "value", ">", "0", "&&", "(", "n...
Increases nonce by value, which is used as an unsigned byte value. @param nonce an unsigned number @param value to be added to nonce
[ "Increases", "nonce", "by", "value", "which", "is", "used", "as", "an", "unsigned", "byte", "value", "." ]
64ee41aee81c537aa27818e93e6afcd2ca1b7844
https://github.com/Dissem/Jabit/blob/64ee41aee81c537aa27818e93e6afcd2ca1b7844/core/src/main/java/ch/dissem/bitmessage/utils/Bytes.java#L41-L53
43,606
baratine/baratine
core/src/main/java/com/caucho/v5/amp/manager/ServicesAmpImpl.java
ServicesAmpImpl.run
@Override public <T> T run(long timeout, TimeUnit unit, Consumer<Result<T>> task) { try (OutboxAmp outbox = OutboxAmp.currentOrCreate(this)) { ResultFuture<T> future = new ResultFuture<>(); task.accept(future); return future.get(timeout, unit); } }
java
@Override public <T> T run(long timeout, TimeUnit unit, Consumer<Result<T>> task) { try (OutboxAmp outbox = OutboxAmp.currentOrCreate(this)) { ResultFuture<T> future = new ResultFuture<>(); task.accept(future); return future.get(timeout, unit); } }
[ "@", "Override", "public", "<", "T", ">", "T", "run", "(", "long", "timeout", ",", "TimeUnit", "unit", ",", "Consumer", "<", "Result", "<", "T", ">", ">", "task", ")", "{", "try", "(", "OutboxAmp", "outbox", "=", "OutboxAmp", ".", "currentOrCreate", ...
Run a task that returns a future in an outbox context.
[ "Run", "a", "task", "that", "returns", "a", "future", "in", "an", "outbox", "context", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/manager/ServicesAmpImpl.java#L357-L368
43,607
baratine/baratine
core/src/main/java/com/caucho/v5/amp/manager/ServicesAmpImpl.java
ServicesAmpImpl.address
@Override public String address(Class<?> api, String address) { Objects.requireNonNull(address); if (address.isEmpty()) { address = addressDefault(api); } int slash = address.indexOf("/"); //int colon = address.indexOf(":"); if (address.endsWith(":") && slash < 0) { addres...
java
@Override public String address(Class<?> api, String address) { Objects.requireNonNull(address); if (address.isEmpty()) { address = addressDefault(api); } int slash = address.indexOf("/"); //int colon = address.indexOf(":"); if (address.endsWith(":") && slash < 0) { addres...
[ "@", "Override", "public", "String", "address", "(", "Class", "<", "?", ">", "api", ",", "String", "address", ")", "{", "Objects", ".", "requireNonNull", "(", "address", ")", ";", "if", "(", "address", ".", "isEmpty", "(", ")", ")", "{", "address", "...
Calculate address from an API with an address default
[ "Calculate", "address", "from", "an", "API", "with", "an", "address", "default" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/manager/ServicesAmpImpl.java#L516-L561
43,608
baratine/baratine
core/src/main/java/com/caucho/v5/amp/manager/ServicesAmpImpl.java
ServicesAmpImpl.bind
@Override public ServiceRefAmp bind(ServiceRefAmp service, String address) { if (log.isLoggable(Level.FINEST)) { log.finest(L.l("bind {0} for {1} in {2}", address, service.api().getType(), this)); } address = toCanonical(address); registry().bind(address, service); ...
java
@Override public ServiceRefAmp bind(ServiceRefAmp service, String address) { if (log.isLoggable(Level.FINEST)) { log.finest(L.l("bind {0} for {1} in {2}", address, service.api().getType(), this)); } address = toCanonical(address); registry().bind(address, service); ...
[ "@", "Override", "public", "ServiceRefAmp", "bind", "(", "ServiceRefAmp", "service", ",", "String", "address", ")", "{", "if", "(", "log", ".", "isLoggable", "(", "Level", ".", "FINEST", ")", ")", "{", "log", ".", "finest", "(", "L", ".", "l", "(", "...
Publish, reusing the mailbox for an existing service.
[ "Publish", "reusing", "the", "mailbox", "for", "an", "existing", "service", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/manager/ServicesAmpImpl.java#L765-L778
43,609
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.isSeedHeartbeatValid
private boolean isSeedHeartbeatValid() { boolean isSeed = false; for (ServerHeartbeat server : _serverSelf.getCluster().getSeedServers()) { if (server.port() > 0) { isSeed = true; if (server.isUp()) { return true; } } } return ! isSeed; }
java
private boolean isSeedHeartbeatValid() { boolean isSeed = false; for (ServerHeartbeat server : _serverSelf.getCluster().getSeedServers()) { if (server.port() > 0) { isSeed = true; if (server.isUp()) { return true; } } } return ! isSeed; }
[ "private", "boolean", "isSeedHeartbeatValid", "(", ")", "{", "boolean", "isSeed", "=", "false", ";", "for", "(", "ServerHeartbeat", "server", ":", "_serverSelf", ".", "getCluster", "(", ")", ".", "getSeedServers", "(", ")", ")", "{", "if", "(", "server", "...
Returns true if one of the cluster seeds is an active server.
[ "Returns", "true", "if", "one", "of", "the", "cluster", "seeds", "is", "an", "active", "server", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L265-L280
43,610
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.join
public UpdateRackHeartbeat join(String extAddress, int extPort, String clusterId, String address, int port, int portBartender, String displayName, String serverHash, ...
java
public UpdateRackHeartbeat join(String extAddress, int extPort, String clusterId, String address, int port, int portBartender, String displayName, String serverHash, ...
[ "public", "UpdateRackHeartbeat", "join", "(", "String", "extAddress", ",", "int", "extPort", ",", "String", "clusterId", ",", "String", "address", ",", "int", "port", ",", "int", "portBartender", ",", "String", "displayName", ",", "String", "serverHash", ",", ...
joinServer message to an external configured address from a new server, including SelfServer. External address discovery and dynamic server joins are powered by join server. @param extAddress the configured IP address of the connection @param extPort the configured IP port of the connection @param address the request...
[ "joinServer", "message", "to", "an", "external", "configured", "address", "from", "a", "new", "server", "including", "SelfServer", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L355-L440
43,611
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.joinSelf
private void joinSelf(ServerHeartbeat server, String extAddress, int extPort, String address, int port, String serverHash) { if (server != _serverSelf) { throw new IllegalStateException(L.l("Invalid self: {0} vs {1}", ...
java
private void joinSelf(ServerHeartbeat server, String extAddress, int extPort, String address, int port, String serverHash) { if (server != _serverSelf) { throw new IllegalStateException(L.l("Invalid self: {0} vs {1}", ...
[ "private", "void", "joinSelf", "(", "ServerHeartbeat", "server", ",", "String", "extAddress", ",", "int", "extPort", ",", "String", "address", ",", "int", "port", ",", "String", "serverHash", ")", "{", "if", "(", "server", "!=", "_serverSelf", ")", "{", "t...
received a join from this server. Used to update external IPs.
[ "received", "a", "join", "from", "this", "server", ".", "Used", "to", "update", "external", "IPs", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L445-L485
43,612
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.hubHeartbeat
public void hubHeartbeat(UpdateServerHeartbeat updateServer, UpdateRackHeartbeat updateRack, UpdatePodSystem updatePod, long sourceTime) { RackHeartbeat rack = getCluster().findRack(updateRack.getId()); if (rack == nul...
java
public void hubHeartbeat(UpdateServerHeartbeat updateServer, UpdateRackHeartbeat updateRack, UpdatePodSystem updatePod, long sourceTime) { RackHeartbeat rack = getCluster().findRack(updateRack.getId()); if (rack == nul...
[ "public", "void", "hubHeartbeat", "(", "UpdateServerHeartbeat", "updateServer", ",", "UpdateRackHeartbeat", "updateRack", ",", "UpdatePodSystem", "updatePod", ",", "long", "sourceTime", ")", "{", "RackHeartbeat", "rack", "=", "getCluster", "(", ")", ".", "findRack", ...
Heartbeat from a hub server includes the heartbeat status of its rack.
[ "Heartbeat", "from", "a", "hub", "server", "includes", "the", "heartbeat", "status", "of", "its", "rack", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L504-L536
43,613
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.updateHubHeartbeatSelf
private void updateHubHeartbeatSelf() { _isHubHeartbeatSelf = true; if (_hubHeartbeatCount < 2) { for (Result<Boolean> result : _hubHeartbeatList) { result.ok(true); } _hubHeartbeatList.clear(); } }
java
private void updateHubHeartbeatSelf() { _isHubHeartbeatSelf = true; if (_hubHeartbeatCount < 2) { for (Result<Boolean> result : _hubHeartbeatList) { result.ok(true); } _hubHeartbeatList.clear(); } }
[ "private", "void", "updateHubHeartbeatSelf", "(", ")", "{", "_isHubHeartbeatSelf", "=", "true", ";", "if", "(", "_hubHeartbeatCount", "<", "2", ")", "{", "for", "(", "Result", "<", "Boolean", ">", "result", ":", "_hubHeartbeatList", ")", "{", "result", ".", ...
If the join is to the self server, and there's only one successful join, update immediately.
[ "If", "the", "join", "is", "to", "the", "self", "server", "and", "there", "s", "only", "one", "successful", "join", "update", "immediately", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L638-L649
43,614
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.updateRack
void updateRack(UpdateRackHeartbeat updateRack) { ClusterHeartbeat cluster = findCluster(updateRack.getClusterId()); if (cluster == null) { return; } RackHeartbeat rack; if (cluster != _serverSelf.getCluster()) { rack = cluster.createRack("external"); ClusterTarget tar...
java
void updateRack(UpdateRackHeartbeat updateRack) { ClusterHeartbeat cluster = findCluster(updateRack.getClusterId()); if (cluster == null) { return; } RackHeartbeat rack; if (cluster != _serverSelf.getCluster()) { rack = cluster.createRack("external"); ClusterTarget tar...
[ "void", "updateRack", "(", "UpdateRackHeartbeat", "updateRack", ")", "{", "ClusterHeartbeat", "cluster", "=", "findCluster", "(", "updateRack", ".", "getClusterId", "(", ")", ")", ";", "if", "(", "cluster", "==", "null", ")", "{", "return", ";", "}", "RackHe...
Process an update message for a rack of servers.
[ "Process", "an", "update", "message", "for", "a", "rack", "of", "servers", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L655-L680
43,615
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.updateServerStart
private void updateServerStart(UpdateServerHeartbeat update) { // internal communication is non-ssl boolean isSSL = false; ServerHeartbeat server = _root.createServer(update.getAddress(), update.getPort(), ...
java
private void updateServerStart(UpdateServerHeartbeat update) { // internal communication is non-ssl boolean isSSL = false; ServerHeartbeat server = _root.createServer(update.getAddress(), update.getPort(), ...
[ "private", "void", "updateServerStart", "(", "UpdateServerHeartbeat", "update", ")", "{", "// internal communication is non-ssl", "boolean", "isSSL", "=", "false", ";", "ServerHeartbeat", "server", "=", "_root", ".", "createServer", "(", "update", ".", "getAddress", "...
Update a server where the update is directly from the peer.
[ "Update", "a", "server", "where", "the", "update", "is", "directly", "from", "the", "peer", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L685-L704
43,616
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.updateServer
void updateServer(ServerHeartbeat server, UpdateServerHeartbeat update) { if (server.isSelf()) { return; } String externalId = update.getExternalId(); updateExternal(server, externalId); // XXX: validation server.setSeedIndex(update.getSeedIndex()); if (server.onHeartbeatUpda...
java
void updateServer(ServerHeartbeat server, UpdateServerHeartbeat update) { if (server.isSelf()) { return; } String externalId = update.getExternalId(); updateExternal(server, externalId); // XXX: validation server.setSeedIndex(update.getSeedIndex()); if (server.onHeartbeatUpda...
[ "void", "updateServer", "(", "ServerHeartbeat", "server", ",", "UpdateServerHeartbeat", "update", ")", "{", "if", "(", "server", ".", "isSelf", "(", ")", ")", "{", "return", ";", "}", "String", "externalId", "=", "update", ".", "getExternalId", "(", ")", "...
Update a server with a heartbeat update. @param server the server to be updated @param update the new update information
[ "Update", "a", "server", "with", "a", "heartbeat", "update", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L712-L733
43,617
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.updateExternal
private void updateExternal(ServerHeartbeat server, String externalId) { if (externalId != null) { ServerHeartbeat serverExternal = _root.getServer(externalId); server.setExternalServer(serverExternal); } else { server.setExternalServer(null); /* if (serverExternal !=...
java
private void updateExternal(ServerHeartbeat server, String externalId) { if (externalId != null) { ServerHeartbeat serverExternal = _root.getServer(externalId); server.setExternalServer(serverExternal); } else { server.setExternalServer(null); /* if (serverExternal !=...
[ "private", "void", "updateExternal", "(", "ServerHeartbeat", "server", ",", "String", "externalId", ")", "{", "if", "(", "externalId", "!=", "null", ")", "{", "ServerHeartbeat", "serverExternal", "=", "_root", ".", "getServer", "(", "externalId", ")", ";", "se...
Update the external server delegation. Cloud static IPs might be routing IPs that aren't local interfaces. In that case, the routing assignment to the dynamic IP must be passed along with the heartbeat.
[ "Update", "the", "external", "server", "delegation", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L742-L761
43,618
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.onServerLinkClose
private void onServerLinkClose(String hostName) { ServerHeartbeat server = _root.getServer(hostName); if (server == null) { return; } if (! isHub(server) && ! isHub(_serverSelf)) { return; } if (server.onHeartbeatStop()) { onServerStop(server); if (server....
java
private void onServerLinkClose(String hostName) { ServerHeartbeat server = _root.getServer(hostName); if (server == null) { return; } if (! isHub(server) && ! isHub(_serverSelf)) { return; } if (server.onHeartbeatStop()) { onServerStop(server); if (server....
[ "private", "void", "onServerLinkClose", "(", "String", "hostName", ")", "{", "ServerHeartbeat", "server", "=", "_root", ".", "getServer", "(", "hostName", ")", ";", "if", "(", "server", "==", "null", ")", "{", "return", ";", "}", "if", "(", "!", "isHub",...
The peer server is now down.
[ "The", "peer", "server", "is", "now", "down", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L805-L826
43,619
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.isHub
private boolean isHub(ServerBartender server) { int upCount = 0; for (ServerHeartbeat rackServer : _rack.getServers()) { if (rackServer == null || ! rackServer.isUp()) { continue; } if (rackServer == server && upCount < _hubCount) { return true; } ...
java
private boolean isHub(ServerBartender server) { int upCount = 0; for (ServerHeartbeat rackServer : _rack.getServers()) { if (rackServer == null || ! rackServer.isUp()) { continue; } if (rackServer == server && upCount < _hubCount) { return true; } ...
[ "private", "boolean", "isHub", "(", "ServerBartender", "server", ")", "{", "int", "upCount", "=", "0", ";", "for", "(", "ServerHeartbeat", "rackServer", ":", "_rack", ".", "getServers", "(", ")", ")", "{", "if", "(", "rackServer", "==", "null", "||", "!"...
Test if the server is a hub server for its rack. The hub are the first few active servers, where the servers are sorted by IP address and port. The default hub count is 3.
[ "Test", "if", "the", "server", "is", "a", "hub", "server", "for", "its", "rack", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L979-L1000
43,620
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.sendHubHeartbeats
private void sendHubHeartbeats() { RackHeartbeat rack = _rack; UpdateRackHeartbeat updateRack = rack.getUpdate(); UpdatePodSystem updatePod = getUpdatePodSystem(); long now = CurrentTime.currentTime(); if (! isJoinComplete()) { updatePod = null; } // send hub update t...
java
private void sendHubHeartbeats() { RackHeartbeat rack = _rack; UpdateRackHeartbeat updateRack = rack.getUpdate(); UpdatePodSystem updatePod = getUpdatePodSystem(); long now = CurrentTime.currentTime(); if (! isJoinComplete()) { updatePod = null; } // send hub update t...
[ "private", "void", "sendHubHeartbeats", "(", ")", "{", "RackHeartbeat", "rack", "=", "_rack", ";", "UpdateRackHeartbeat", "updateRack", "=", "rack", ".", "getUpdate", "(", ")", ";", "UpdatePodSystem", "updatePod", "=", "getUpdatePodSystem", "(", ")", ";", "long"...
Sends full heartbeat messages to all targets. Hub heartbeat messages contains all the servers in the hub and all the pods known to the hub server. @param type
[ "Sends", "full", "heartbeat", "messages", "to", "all", "targets", ".", "Hub", "heartbeat", "messages", "contains", "all", "the", "servers", "in", "the", "hub", "and", "all", "the", "pods", "known", "to", "the", "hub", "server", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L1008-L1034
43,621
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java
HeartbeatImpl.sendSpokeHeartbeats
private void sendSpokeHeartbeats() { for (ServerTarget target : _targets) { ServerHeartbeat server = target.getServer(); if (server.getRack() != _rack) { continue; } if (isHub(server)) { target.sendServerHeartbeat(getServerSelf().getUpdate()); } } ...
java
private void sendSpokeHeartbeats() { for (ServerTarget target : _targets) { ServerHeartbeat server = target.getServer(); if (server.getRack() != _rack) { continue; } if (isHub(server)) { target.sendServerHeartbeat(getServerSelf().getUpdate()); } } ...
[ "private", "void", "sendSpokeHeartbeats", "(", ")", "{", "for", "(", "ServerTarget", "target", ":", "_targets", ")", "{", "ServerHeartbeat", "server", "=", "target", ".", "getServer", "(", ")", ";", "if", "(", "server", ".", "getRack", "(", ")", "!=", "_...
Sends a server status message to the hub servers. The server message contains the status for the current server.
[ "Sends", "a", "server", "status", "message", "to", "the", "hub", "servers", ".", "The", "server", "message", "contains", "the", "status", "for", "the", "current", "server", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/HeartbeatImpl.java#L1040-L1053
43,622
baratine/baratine
framework/src/main/java/com/caucho/v5/profile/HeapDump.java
HeapDump.isAvailable
public static boolean isAvailable() { try { return create() != null; } catch (Exception e) { log.log(Level.FINEST, e.toString(), e); return false; } }
java
public static boolean isAvailable() { try { return create() != null; } catch (Exception e) { log.log(Level.FINEST, e.toString(), e); return false; } }
[ "public", "static", "boolean", "isAvailable", "(", ")", "{", "try", "{", "return", "create", "(", ")", "!=", "null", ";", "}", "catch", "(", "Exception", "e", ")", "{", "log", ".", "log", "(", "Level", ".", "FINEST", ",", "e", ".", "toString", "(",...
Checks if the heap is available
[ "Checks", "if", "the", "heap", "is", "available" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/profile/HeapDump.java#L77-L86
43,623
Dissem/Jabit
core/src/main/java/ch/dissem/bitmessage/factory/V3MessageReader.java
V3MessageReader.cleanup
public void cleanup() { state = null; if (headerBuffer != null) { bufferPool.deallocate(headerBuffer); } if (dataBuffer != null) { bufferPool.deallocate(dataBuffer); } }
java
public void cleanup() { state = null; if (headerBuffer != null) { bufferPool.deallocate(headerBuffer); } if (dataBuffer != null) { bufferPool.deallocate(dataBuffer); } }
[ "public", "void", "cleanup", "(", ")", "{", "state", "=", "null", ";", "if", "(", "headerBuffer", "!=", "null", ")", "{", "bufferPool", ".", "deallocate", "(", "headerBuffer", ")", ";", "}", "if", "(", "dataBuffer", "!=", "null", ")", "{", "bufferPool"...
De-allocates all buffers. This method should be called iff the reader isn't used anymore, i.e. when its connection is severed.
[ "De", "-", "allocates", "all", "buffers", ".", "This", "method", "should", "be", "called", "iff", "the", "reader", "isn", "t", "used", "anymore", "i", ".", "e", ".", "when", "its", "connection", "is", "severed", "." ]
64ee41aee81c537aa27818e93e6afcd2ca1b7844
https://github.com/Dissem/Jabit/blob/64ee41aee81c537aa27818e93e6afcd2ca1b7844/core/src/main/java/ch/dissem/bitmessage/factory/V3MessageReader.java#L178-L186
43,624
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/ServerTarget.java
ServerTarget.clusterHeartbeat
void clusterHeartbeat(String clusterId, UpdateServerHeartbeat updateSelf, UpdateRackHeartbeat updateRack, UpdatePodSystem updatePod, long sequence) { if (startUpdate(updateRack, updatePod)) { getHeartbeat().clust...
java
void clusterHeartbeat(String clusterId, UpdateServerHeartbeat updateSelf, UpdateRackHeartbeat updateRack, UpdatePodSystem updatePod, long sequence) { if (startUpdate(updateRack, updatePod)) { getHeartbeat().clust...
[ "void", "clusterHeartbeat", "(", "String", "clusterId", ",", "UpdateServerHeartbeat", "updateSelf", ",", "UpdateRackHeartbeat", "updateRack", ",", "UpdatePodSystem", "updatePod", ",", "long", "sequence", ")", "{", "if", "(", "startUpdate", "(", "updateRack", ",", "u...
Sends a cluster heartbeat message if the update has changed, or it's time for a periodic heartbeat. The cluster heartbeat message include all information for a foreign cluster.
[ "Sends", "a", "cluster", "heartbeat", "message", "if", "the", "update", "has", "changed", "or", "it", "s", "time", "for", "a", "periodic", "heartbeat", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/ServerTarget.java#L87-L96
43,625
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/ServerTarget.java
ServerTarget.hubHeartbeat
void hubHeartbeat(UpdateServerHeartbeat updateServer, UpdateRackHeartbeat updateRack, UpdatePodSystem updatePod, long sequence) { if (startUpdate(updateRack, updatePod)) { getHeartbeat().hubHeartbeat(updateServer, updateRack, updatePod, sequence); ...
java
void hubHeartbeat(UpdateServerHeartbeat updateServer, UpdateRackHeartbeat updateRack, UpdatePodSystem updatePod, long sequence) { if (startUpdate(updateRack, updatePod)) { getHeartbeat().hubHeartbeat(updateServer, updateRack, updatePod, sequence); ...
[ "void", "hubHeartbeat", "(", "UpdateServerHeartbeat", "updateServer", ",", "UpdateRackHeartbeat", "updateRack", ",", "UpdatePodSystem", "updatePod", ",", "long", "sequence", ")", "{", "if", "(", "startUpdate", "(", "updateRack", ",", "updatePod", ")", ")", "{", "g...
Sends a hub heartbeat message if the update has changed, or it's time for a periodic heartbeat. The hub heartbeat message include all information for the current cluster from a hub server.
[ "Sends", "a", "hub", "heartbeat", "message", "if", "the", "update", "has", "changed", "or", "it", "s", "time", "for", "a", "periodic", "heartbeat", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/ServerTarget.java#L105-L113
43,626
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/ServerTarget.java
ServerTarget.startUpdate
private boolean startUpdate(UpdateRackHeartbeat updateRack, UpdatePodSystem updatePod) { long now = CurrentTime.currentTime(); if (_lastHubTime + getTimeout() < now) { } else if (_lastRackCrc != updateRack.getCrc()) { } else if (updatePod != null && _lastPodC...
java
private boolean startUpdate(UpdateRackHeartbeat updateRack, UpdatePodSystem updatePod) { long now = CurrentTime.currentTime(); if (_lastHubTime + getTimeout() < now) { } else if (_lastRackCrc != updateRack.getCrc()) { } else if (updatePod != null && _lastPodC...
[ "private", "boolean", "startUpdate", "(", "UpdateRackHeartbeat", "updateRack", ",", "UpdatePodSystem", "updatePod", ")", "{", "long", "now", "=", "CurrentTime", ".", "currentTime", "(", ")", ";", "if", "(", "_lastHubTime", "+", "getTimeout", "(", ")", "<", "no...
Only send updates on changes or timeouts.
[ "Only", "send", "updates", "on", "changes", "or", "timeouts", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/ServerTarget.java#L118-L141
43,627
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/pod/NodePodProxy.java
NodePodProxy.owner
@Override public int owner(int hash) { NodePodAmp delegate = delegate(); if (delegate != null) { return delegate().owner(hash); } else { return 0; } }
java
@Override public int owner(int hash) { NodePodAmp delegate = delegate(); if (delegate != null) { return delegate().owner(hash); } else { return 0; } }
[ "@", "Override", "public", "int", "owner", "(", "int", "hash", ")", "{", "NodePodAmp", "delegate", "=", "delegate", "(", ")", ";", "if", "(", "delegate", "!=", "null", ")", "{", "return", "delegate", "(", ")", ".", "owner", "(", "hash", ")", ";", "...
The owner index for the node.
[ "The", "owner", "index", "for", "the", "node", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/NodePodProxy.java#L121-L132
43,628
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/hamp/LinkHamp.java
LinkHamp.run
@Override public void run() { try { while (! isClosed() && _is.read() > 0 && _in.readMessage(_is)) { ServiceRef.flushOutbox(); } } catch (EOFException e) { log.finer(this + " end of file"); if (log.isLoggable(Level.ALL)) { log.log(Level.ALL, e.toString(), e); ...
java
@Override public void run() { try { while (! isClosed() && _is.read() > 0 && _in.readMessage(_is)) { ServiceRef.flushOutbox(); } } catch (EOFException e) { log.finer(this + " end of file"); if (log.isLoggable(Level.ALL)) { log.log(Level.ALL, e.toString(), e); ...
[ "@", "Override", "public", "void", "run", "(", ")", "{", "try", "{", "while", "(", "!", "isClosed", "(", ")", "&&", "_is", ".", "read", "(", ")", ">", "0", "&&", "_in", ".", "readMessage", "(", "_is", ")", ")", "{", "ServiceRef", ".", "flushOutbo...
Receive messages from the client
[ "Receive", "messages", "from", "the", "client" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/hamp/LinkHamp.java#L196-L225
43,629
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.getHost
@Override protected CharSequence getHost() { if (_host != null) return _host; if (_uriHost.length() > 0) { _host = _uriHost; } else if ((_host = getForwardedHostHeader()) != null) { } else { _host = getHostHeader(); } return _host; }
java
@Override protected CharSequence getHost() { if (_host != null) return _host; if (_uriHost.length() > 0) { _host = _uriHost; } else if ((_host = getForwardedHostHeader()) != null) { } else { _host = getHostHeader(); } return _host; }
[ "@", "Override", "protected", "CharSequence", "getHost", "(", ")", "{", "if", "(", "_host", "!=", "null", ")", "return", "_host", ";", "if", "(", "_uriHost", ".", "length", "(", ")", ">", "0", ")", "{", "_host", "=", "_uriHost", ";", "}", "else", "...
Returns the virtual host of the request
[ "Returns", "the", "virtual", "host", "of", "the", "request" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L277-L293
43,630
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.hostInvocation
private CharSequence hostInvocation() throws IOException { if (_host != null) { } else if (_uriHost.length() > 0) { _host = _uriHost; } else if ((_host = getForwardedHostHeader()) != null) { } else if ((_host = getHostHeader()) != null) { } else if (HTTP_1_1 <= version())...
java
private CharSequence hostInvocation() throws IOException { if (_host != null) { } else if (_uriHost.length() > 0) { _host = _uriHost; } else if ((_host = getForwardedHostHeader()) != null) { } else if ((_host = getHostHeader()) != null) { } else if (HTTP_1_1 <= version())...
[ "private", "CharSequence", "hostInvocation", "(", ")", "throws", "IOException", "{", "if", "(", "_host", "!=", "null", ")", "{", "}", "else", "if", "(", "_uriHost", ".", "length", "(", ")", ">", "0", ")", "{", "_host", "=", "_uriHost", ";", "}", "els...
Returns the virtual host from the invocation
[ "Returns", "the", "virtual", "host", "from", "the", "invocation" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L298-L316
43,631
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.header
@Override public String header(String key) { CharSegment buf = getHeaderBuffer(key); if (buf != null) return buf.toString(); else return null; }
java
@Override public String header(String key) { CharSegment buf = getHeaderBuffer(key); if (buf != null) return buf.toString(); else return null; }
[ "@", "Override", "public", "String", "header", "(", "String", "key", ")", "{", "CharSegment", "buf", "=", "getHeaderBuffer", "(", "key", ")", ";", "if", "(", "buf", "!=", "null", ")", "return", "buf", ".", "toString", "(", ")", ";", "else", "return", ...
Returns the header.
[ "Returns", "the", "header", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L426-L435
43,632
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.getHeaderBuffer
public CharSegment getHeaderBuffer(char []testBuf, int length) { char []keyBuf = _headerBuffer; CharSegment []headerKeys = _headerKeys; char []toLowerAscii = _toLowerAscii; for (int i = _headerSize - 1; i >= 0; i--) { CharSegment key = headerKeys[i]; if (key.length() != length) ...
java
public CharSegment getHeaderBuffer(char []testBuf, int length) { char []keyBuf = _headerBuffer; CharSegment []headerKeys = _headerKeys; char []toLowerAscii = _toLowerAscii; for (int i = _headerSize - 1; i >= 0; i--) { CharSegment key = headerKeys[i]; if (key.length() != length) ...
[ "public", "CharSegment", "getHeaderBuffer", "(", "char", "[", "]", "testBuf", ",", "int", "length", ")", "{", "char", "[", "]", "keyBuf", "=", "_headerBuffer", ";", "CharSegment", "[", "]", "headerKeys", "=", "_headerKeys", ";", "char", "[", "]", "toLowerA...
Returns the matching header. @param testBuf header key @param length length of the key.
[ "Returns", "the", "matching", "header", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L470-L504
43,633
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.getHeaderBuffer
@Override public CharSegment getHeaderBuffer(String key) { int i = matchNextHeader(0, key); if (i >= 0) { return _headerValues[i]; } else { return null; } }
java
@Override public CharSegment getHeaderBuffer(String key) { int i = matchNextHeader(0, key); if (i >= 0) { return _headerValues[i]; } else { return null; } }
[ "@", "Override", "public", "CharSegment", "getHeaderBuffer", "(", "String", "key", ")", "{", "int", "i", "=", "matchNextHeader", "(", "0", ",", "key", ")", ";", "if", "(", "i", ">=", "0", ")", "{", "return", "_headerValues", "[", "i", "]", ";", "}", ...
Returns the header value for the key, returned as a CharSegment.
[ "Returns", "the", "header", "value", "for", "the", "key", "returned", "as", "a", "CharSegment", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L509-L520
43,634
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.getHeaderBuffers
@Override public void getHeaderBuffers(String key, ArrayList<CharSegment> values) { int i = -1; while ((i = matchNextHeader(i + 1, key)) >= 0) { values.add(_headerValues[i]); } }
java
@Override public void getHeaderBuffers(String key, ArrayList<CharSegment> values) { int i = -1; while ((i = matchNextHeader(i + 1, key)) >= 0) { values.add(_headerValues[i]); } }
[ "@", "Override", "public", "void", "getHeaderBuffers", "(", "String", "key", ",", "ArrayList", "<", "CharSegment", ">", "values", ")", "{", "int", "i", "=", "-", "1", ";", "while", "(", "(", "i", "=", "matchNextHeader", "(", "i", "+", "1", ",", "key"...
Fills an ArrayList with the header values matching the key. @param values ArrayList which will contain the maching values. @param key the header key to select.
[ "Fills", "an", "ArrayList", "with", "the", "header", "values", "matching", "the", "key", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L528-L536
43,635
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.getHeaders
@Override public Enumeration<String> getHeaders(String key) { ArrayList<String> values = new ArrayList<String>(); int i = -1; while ((i = matchNextHeader(i + 1, key)) >= 0) { values.add(_headerValues[i].toString()); } return Collections.enumeration(values); }
java
@Override public Enumeration<String> getHeaders(String key) { ArrayList<String> values = new ArrayList<String>(); int i = -1; while ((i = matchNextHeader(i + 1, key)) >= 0) { values.add(_headerValues[i].toString()); } return Collections.enumeration(values); }
[ "@", "Override", "public", "Enumeration", "<", "String", ">", "getHeaders", "(", "String", "key", ")", "{", "ArrayList", "<", "String", ">", "values", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "int", "i", "=", "-", "1", ";", "while"...
Return an enumeration of headers matching a key. @param key the header key to match. @return the enumeration of the headers.
[ "Return", "an", "enumeration", "of", "headers", "matching", "a", "key", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L544-L555
43,636
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.matchNextHeader
private int matchNextHeader(int i, String key) { int size = _headerSize; int length = key.length(); char []keyBuf = _headerBuffer; char []toLowerAscii = _toLowerAscii; for (; i < size; i++) { CharSegment header = _headerKeys[i]; if (header.length() != length) continue; ...
java
private int matchNextHeader(int i, String key) { int size = _headerSize; int length = key.length(); char []keyBuf = _headerBuffer; char []toLowerAscii = _toLowerAscii; for (; i < size; i++) { CharSegment header = _headerKeys[i]; if (header.length() != length) continue; ...
[ "private", "int", "matchNextHeader", "(", "int", "i", ",", "String", "key", ")", "{", "int", "size", "=", "_headerSize", ";", "int", "length", "=", "key", ".", "length", "(", ")", ";", "char", "[", "]", "keyBuf", "=", "_headerBuffer", ";", "char", "[...
Returns the index of the next header matching the key. @param i header index to start search @param key header key to match @return the index of the next header matching, or -1.
[ "Returns", "the", "index", "of", "the", "next", "header", "matching", "the", "key", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L565-L600
43,637
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.setHeader
@Override public void setHeader(String key, String value) { int tail; if (_headerSize > 0) { tail = (_headerValues[_headerSize - 1].offset() + _headerValues[_headerSize - 1].length()); } else { tail = 0; } int keyLength = key.length(); int valueLength = value....
java
@Override public void setHeader(String key, String value) { int tail; if (_headerSize > 0) { tail = (_headerValues[_headerSize - 1].offset() + _headerValues[_headerSize - 1].length()); } else { tail = 0; } int keyLength = key.length(); int valueLength = value....
[ "@", "Override", "public", "void", "setHeader", "(", "String", "key", ",", "String", "value", ")", "{", "int", "tail", ";", "if", "(", "_headerSize", ">", "0", ")", "{", "tail", "=", "(", "_headerValues", "[", "_headerSize", "-", "1", "]", ".", "offs...
Adds a new header. Used only by the caching to simulate If-Modified-Since. @param key the key of the new header @param value the value for the new header
[ "Adds", "a", "new", "header", ".", "Used", "only", "by", "the", "caching", "to", "simulate", "If", "-", "Modified", "-", "Since", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L609-L641
43,638
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.parseRequest
private boolean parseRequest() throws IOException { try { ReadStream is = connTcp().readStream(); if (! readRequest(is)) { clearRequest(); return false; } _sequence = connHttp().nextSequenceRead(); if (log.isLoggable(Level.FINE)) { log.fine...
java
private boolean parseRequest() throws IOException { try { ReadStream is = connTcp().readStream(); if (! readRequest(is)) { clearRequest(); return false; } _sequence = connHttp().nextSequenceRead(); if (log.isLoggable(Level.FINE)) { log.fine...
[ "private", "boolean", "parseRequest", "(", ")", "throws", "IOException", "{", "try", "{", "ReadStream", "is", "=", "connTcp", "(", ")", ".", "readStream", "(", ")", ";", "if", "(", "!", "readRequest", "(", "is", ")", ")", "{", "clearRequest", "(", ")",...
Parses a http request.
[ "Parses", "a", "http", "request", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L681-L721
43,639
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.initRequest
@Override protected void initRequest() { super.initRequest(); _state = _state.toActive(); // HttpBufferStore httpBuffer = getHttpBufferStore(); HttpBufferStore bufferStore = getHttpBufferStore(); _method.clear(); _methodString = null; _protocol.clear(); _uriLength = 0; ...
java
@Override protected void initRequest() { super.initRequest(); _state = _state.toActive(); // HttpBufferStore httpBuffer = getHttpBufferStore(); HttpBufferStore bufferStore = getHttpBufferStore(); _method.clear(); _methodString = null; _protocol.clear(); _uriLength = 0; ...
[ "@", "Override", "protected", "void", "initRequest", "(", ")", "{", "super", ".", "initRequest", "(", ")", ";", "_state", "=", "_state", ".", "toActive", "(", ")", ";", "// HttpBufferStore httpBuffer = getHttpBufferStore();", "HttpBufferStore", "bufferStore", "=", ...
Clear the request variables in preparation for a new request. @param s the read stream for the request
[ "Clear", "the", "request", "variables", "in", "preparation", "for", "a", "new", "request", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L735-L769
43,640
baratine/baratine
web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java
RequestHttp1.onTimeout
@Override public void onTimeout() { try { //request().sendError(WebRequest.INTERNAL_SERVER_ERROR); if (true) throw new UnsupportedOperationException(); } catch (Exception e) { log.log(Level.FINEST, e.toString(), e); } closeResponse(); }
java
@Override public void onTimeout() { try { //request().sendError(WebRequest.INTERNAL_SERVER_ERROR); if (true) throw new UnsupportedOperationException(); } catch (Exception e) { log.log(Level.FINEST, e.toString(), e); } closeResponse(); }
[ "@", "Override", "public", "void", "onTimeout", "(", ")", "{", "try", "{", "//request().sendError(WebRequest.INTERNAL_SERVER_ERROR);", "if", "(", "true", ")", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")",...
Handles a timeout.
[ "Handles", "a", "timeout", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttp1.java#L1662-L1673
43,641
SeaCloudsEU/SeaCloudsPlatform
sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/PenaltyRestEntity.java
PenaltyRestEntity.getPenaltyByUuid
@GET @Path("{uuid}") public Penalty getPenaltyByUuid(@PathParam("uuid") UUID uuid) { logger.debug("StartOf getPenaltyByUuid - REQUEST for /penalties/{}", uuid); PenaltyHelperE penaltyRestHelper = getPenaltyHelper(); Penalty result = penaltyRestHelper.getPenaltyByUuid(uuid); logge...
java
@GET @Path("{uuid}") public Penalty getPenaltyByUuid(@PathParam("uuid") UUID uuid) { logger.debug("StartOf getPenaltyByUuid - REQUEST for /penalties/{}", uuid); PenaltyHelperE penaltyRestHelper = getPenaltyHelper(); Penalty result = penaltyRestHelper.getPenaltyByUuid(uuid); logge...
[ "@", "GET", "@", "Path", "(", "\"{uuid}\"", ")", "public", "Penalty", "getPenaltyByUuid", "(", "@", "PathParam", "(", "\"uuid\"", ")", "UUID", "uuid", ")", "{", "logger", ".", "debug", "(", "\"StartOf getPenaltyByUuid - REQUEST for /penalties/{}\"", ",", "uuid", ...
Returns the information of an specific penalty given an uuid. @return violations according to parameters in the query string.
[ "Returns", "the", "information", "of", "an", "specific", "penalty", "given", "an", "uuid", "." ]
b199fe6de2c63b808cb248d3aca947d802375df8
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/PenaltyRestEntity.java#L68-L76
43,642
SeaCloudsEU/SeaCloudsPlatform
sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/PenaltyRestEntity.java
PenaltyRestEntity.getPenalties
@GET public List<Penalty> getPenalties( @QueryParam("agreementId") String agreementId, @QueryParam("guaranteeTerm") String guaranteeTerm, @QueryParam("begin") DateParam begin, @QueryParam("end") DateParam end) throws InternalException{ logger.debug("StartOf getPenalties...
java
@GET public List<Penalty> getPenalties( @QueryParam("agreementId") String agreementId, @QueryParam("guaranteeTerm") String guaranteeTerm, @QueryParam("begin") DateParam begin, @QueryParam("end") DateParam end) throws InternalException{ logger.debug("StartOf getPenalties...
[ "@", "GET", "public", "List", "<", "Penalty", ">", "getPenalties", "(", "@", "QueryParam", "(", "\"agreementId\"", ")", "String", "agreementId", ",", "@", "QueryParam", "(", "\"guaranteeTerm\"", ")", "String", "guaranteeTerm", ",", "@", "QueryParam", "(", "\"b...
Search penalties given several query terms. If no parameters specified, return all penalties. @param agreementId @param guaranteeTerm @param begin @param end @return penalties according to parameters in the query string.
[ "Search", "penalties", "given", "several", "query", "terms", "." ]
b199fe6de2c63b808cb248d3aca947d802375df8
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/PenaltyRestEntity.java#L89-L109
43,643
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/network/ServerNetwork.java
ServerNetwork.getLoadBalanceSocketPool
public final ClientSocketFactory getLoadBalanceSocketPool() { ClientSocketFactory factory = getLoadBalanceSocketFactory(); if (factory == null) return null; if (_serverBartender.getState().isDisableSoft()) { factory.enableSessionOnly(); } else if (_serverBartender.getState()....
java
public final ClientSocketFactory getLoadBalanceSocketPool() { ClientSocketFactory factory = getLoadBalanceSocketFactory(); if (factory == null) return null; if (_serverBartender.getState().isDisableSoft()) { factory.enableSessionOnly(); } else if (_serverBartender.getState()....
[ "public", "final", "ClientSocketFactory", "getLoadBalanceSocketPool", "(", ")", "{", "ClientSocketFactory", "factory", "=", "getLoadBalanceSocketFactory", "(", ")", ";", "if", "(", "factory", "==", "null", ")", "return", "null", ";", "if", "(", "_serverBartender", ...
Returns the socket pool as a load-balancer.
[ "Returns", "the", "socket", "pool", "as", "a", "load", "-", "balancer", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/network/ServerNetwork.java#L903-L922
43,644
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/network/ServerNetwork.java
ServerNetwork.onHeartbeatStop
boolean onHeartbeatStop() { SocketPool clusterSocketPool; if (isExternal()) { clusterSocketPool = _clusterSocketPool.getAndSet(null); } else { clusterSocketPool = _clusterSocketPool.get(); } if (clusterSocketPool != null) { clusterSocketPool.getFactory().notifyHeartbeat...
java
boolean onHeartbeatStop() { SocketPool clusterSocketPool; if (isExternal()) { clusterSocketPool = _clusterSocketPool.getAndSet(null); } else { clusterSocketPool = _clusterSocketPool.get(); } if (clusterSocketPool != null) { clusterSocketPool.getFactory().notifyHeartbeat...
[ "boolean", "onHeartbeatStop", "(", ")", "{", "SocketPool", "clusterSocketPool", ";", "if", "(", "isExternal", "(", ")", ")", "{", "clusterSocketPool", "=", "_clusterSocketPool", ".", "getAndSet", "(", "null", ")", ";", "}", "else", "{", "clusterSocketPool", "=...
Notify that a stop event has been received.
[ "Notify", "that", "a", "stop", "event", "has", "been", "received", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/network/ServerNetwork.java#L1197-L1221
43,645
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/network/ServerNetwork.java
ServerNetwork.close
public void close() { SocketPool loadBalancePool = _loadBalanceSocketPool.get(); if (loadBalancePool != null) loadBalancePool.getFactory().close(); SocketPool clusterPool = _clusterSocketPool.get(); if (clusterPool != null) clusterPool.getFactory().close(); }
java
public void close() { SocketPool loadBalancePool = _loadBalanceSocketPool.get(); if (loadBalancePool != null) loadBalancePool.getFactory().close(); SocketPool clusterPool = _clusterSocketPool.get(); if (clusterPool != null) clusterPool.getFactory().close(); }
[ "public", "void", "close", "(", ")", "{", "SocketPool", "loadBalancePool", "=", "_loadBalanceSocketPool", ".", "get", "(", ")", ";", "if", "(", "loadBalancePool", "!=", "null", ")", "loadBalancePool", ".", "getFactory", "(", ")", ".", "close", "(", ")", ";...
Close any ports.
[ "Close", "any", "ports", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/network/ServerNetwork.java#L1279-L1290
43,646
baratine/baratine
kraken/src/main/java/com/caucho/v5/h3/io/OutFactoryH3Impl.java
OutFactoryH3Impl.schema
@Override public void schema(Class<?> type) { Objects.requireNonNull(type); _context.schema(type); }
java
@Override public void schema(Class<?> type) { Objects.requireNonNull(type); _context.schema(type); }
[ "@", "Override", "public", "void", "schema", "(", "Class", "<", "?", ">", "type", ")", "{", "Objects", ".", "requireNonNull", "(", "type", ")", ";", "_context", ".", "schema", "(", "type", ")", ";", "}" ]
Adds a predefined schema
[ "Adds", "a", "predefined", "schema" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/h3/io/OutFactoryH3Impl.java#L64-L70
43,647
baratine/baratine
core/src/main/java/com/caucho/v5/util/RandomUtil.java
RandomUtil.getRandomLong
public static long getRandomLong() { Random random = getRandom(); long value = random.nextLong(); if (! _isTest) { _freeRandomList.free(random); } return value; }
java
public static long getRandomLong() { Random random = getRandom(); long value = random.nextLong(); if (! _isTest) { _freeRandomList.free(random); } return value; }
[ "public", "static", "long", "getRandomLong", "(", ")", "{", "Random", "random", "=", "getRandom", "(", ")", ";", "long", "value", "=", "random", ".", "nextLong", "(", ")", ";", "if", "(", "!", "_isTest", ")", "{", "_freeRandomList", ".", "free", "(", ...
Returns the next random long.
[ "Returns", "the", "next", "random", "long", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/RandomUtil.java#L49-L60
43,648
baratine/baratine
core/src/main/java/com/caucho/v5/util/RandomUtil.java
RandomUtil.nextInt
public static int nextInt(int n) { Random random = getRandom(); int value = random.nextInt(n); if (! _isTest) _freeRandomList.free(random); return value; }
java
public static int nextInt(int n) { Random random = getRandom(); int value = random.nextInt(n); if (! _isTest) _freeRandomList.free(random); return value; }
[ "public", "static", "int", "nextInt", "(", "int", "n", ")", "{", "Random", "random", "=", "getRandom", "(", ")", ";", "int", "value", "=", "random", ".", "nextInt", "(", "n", ")", ";", "if", "(", "!", "_isTest", ")", "_freeRandomList", ".", "free", ...
Returns the next random int.
[ "Returns", "the", "next", "random", "int", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/RandomUtil.java#L65-L75
43,649
baratine/baratine
core/src/main/java/com/caucho/v5/util/RandomUtil.java
RandomUtil.nextDouble
public static double nextDouble() { Random random = getRandom(); double value = random.nextDouble(); if (! _isTest) _freeRandomList.free(random); return value; }
java
public static double nextDouble() { Random random = getRandom(); double value = random.nextDouble(); if (! _isTest) _freeRandomList.free(random); return value; }
[ "public", "static", "double", "nextDouble", "(", ")", "{", "Random", "random", "=", "getRandom", "(", ")", ";", "double", "value", "=", "random", ".", "nextDouble", "(", ")", ";", "if", "(", "!", "_isTest", ")", "_freeRandomList", ".", "free", "(", "ra...
Returns the next random double between 0 and 1
[ "Returns", "the", "next", "random", "double", "between", "0", "and", "1" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/RandomUtil.java#L80-L90
43,650
baratine/baratine
core/src/main/java/com/caucho/v5/util/RandomUtil.java
RandomUtil.getRandom
public static Random getRandom() { if (_isTest) { return _testRandom; } Random random = _freeRandomList.allocate(); if (random == null) { random = new SecureRandom(); } return random; }
java
public static Random getRandom() { if (_isTest) { return _testRandom; } Random random = _freeRandomList.allocate(); if (random == null) { random = new SecureRandom(); } return random; }
[ "public", "static", "Random", "getRandom", "(", ")", "{", "if", "(", "_isTest", ")", "{", "return", "_testRandom", ";", "}", "Random", "random", "=", "_freeRandomList", ".", "allocate", "(", ")", ";", "if", "(", "random", "==", "null", ")", "{", "rando...
Returns the random generator.
[ "Returns", "the", "random", "generator", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/RandomUtil.java#L95-L108
43,651
baratine/baratine
kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java
OutRawH3Impl.writeChunk
@Override public void writeChunk(long length, boolean isFinal) { long chunk; if (isFinal) { chunk = length << 1; } else { chunk = (length << 1) + 1; } writeUnsigned(chunk); }
java
@Override public void writeChunk(long length, boolean isFinal) { long chunk; if (isFinal) { chunk = length << 1; } else { chunk = (length << 1) + 1; } writeUnsigned(chunk); }
[ "@", "Override", "public", "void", "writeChunk", "(", "long", "length", ",", "boolean", "isFinal", ")", "{", "long", "chunk", ";", "if", "(", "isFinal", ")", "{", "chunk", "=", "length", "<<", "1", ";", "}", "else", "{", "chunk", "=", "(", "length", ...
chunked header. LSB
[ "chunked", "header", ".", "LSB" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java#L201-L214
43,652
baratine/baratine
kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java
OutRawH3Impl.writeStringData
@Override public void writeStringData(String value, int offset, int length) { char []cBuf = _charBuffer; int cBufLength = cBuf.length; for (int i = 0; i < length; i += cBufLength) { int sublen = Math.min(length - i, cBufLength); value.getChars(offset + i, offset + i + sublen, cBu...
java
@Override public void writeStringData(String value, int offset, int length) { char []cBuf = _charBuffer; int cBufLength = cBuf.length; for (int i = 0; i < length; i += cBufLength) { int sublen = Math.min(length - i, cBufLength); value.getChars(offset + i, offset + i + sublen, cBu...
[ "@", "Override", "public", "void", "writeStringData", "(", "String", "value", ",", "int", "offset", ",", "int", "length", ")", "{", "char", "[", "]", "cBuf", "=", "_charBuffer", ";", "int", "cBufLength", "=", "cBuf", ".", "length", ";", "for", "(", "in...
string data without length
[ "string", "data", "without", "length" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java#L219-L232
43,653
baratine/baratine
kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java
OutRawH3Impl.writeBinaryData
@Override public void writeBinaryData(byte []sBuf, int sOffset, int sLength) { byte []tBuf = _buffer; int tOffset = _offset; int tLength = tBuf.length; int end = sOffset + sLength; while (sOffset < end) { if (tLength - tOffset < 1) { tOffset = flush(tOffset); } ...
java
@Override public void writeBinaryData(byte []sBuf, int sOffset, int sLength) { byte []tBuf = _buffer; int tOffset = _offset; int tLength = tBuf.length; int end = sOffset + sLength; while (sOffset < end) { if (tLength - tOffset < 1) { tOffset = flush(tOffset); } ...
[ "@", "Override", "public", "void", "writeBinaryData", "(", "byte", "[", "]", "sBuf", ",", "int", "sOffset", ",", "int", "sLength", ")", "{", "byte", "[", "]", "tBuf", "=", "_buffer", ";", "int", "tOffset", "=", "_offset", ";", "int", "tLength", "=", ...
binary data without type or length
[ "binary", "data", "without", "type", "or", "length" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java#L275-L298
43,654
baratine/baratine
kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java
OutRawH3Impl.require
private void require(int len) { int offset = _offset; int length = _length; if (offset + len < length) { return; } flush(_offset); }
java
private void require(int len) { int offset = _offset; int length = _length; if (offset + len < length) { return; } flush(_offset); }
[ "private", "void", "require", "(", "int", "len", ")", "{", "int", "offset", "=", "_offset", ";", "int", "length", "=", "_length", ";", "if", "(", "offset", "+", "len", "<", "length", ")", "{", "return", ";", "}", "flush", "(", "_offset", ")", ";", ...
Require empty space in the output buffer. If not enough space is available, flush the buffer.
[ "Require", "empty", "space", "in", "the", "output", "buffer", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java#L305-L315
43,655
baratine/baratine
kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java
OutRawH3Impl.flush
private int flush(int offset) { try { _os.write(_buffer, 0, offset); _offset = 0; return 0; } catch (IOException e) { throw new H3ExceptionOut(e); } }
java
private int flush(int offset) { try { _os.write(_buffer, 0, offset); _offset = 0; return 0; } catch (IOException e) { throw new H3ExceptionOut(e); } }
[ "private", "int", "flush", "(", "int", "offset", ")", "{", "try", "{", "_os", ".", "write", "(", "_buffer", ",", "0", ",", "offset", ")", ";", "_offset", "=", "0", ";", "return", "0", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw",...
Flush the buffer and set the offset to zero.
[ "Flush", "the", "buffer", "and", "set", "the", "offset", "to", "zero", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java#L320-L330
43,656
baratine/baratine
kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java
OutRawH3Impl.writeRef
@Override public void writeRef(int ref) { require(1); _buffer[_offset++] = (byte) ConstH3.REF; writeUnsigned(ref); }
java
@Override public void writeRef(int ref) { require(1); _buffer[_offset++] = (byte) ConstH3.REF; writeUnsigned(ref); }
[ "@", "Override", "public", "void", "writeRef", "(", "int", "ref", ")", "{", "require", "(", "1", ")", ";", "_buffer", "[", "_offset", "++", "]", "=", "(", "byte", ")", "ConstH3", ".", "REF", ";", "writeUnsigned", "(", "ref", ")", ";", "}" ]
write graph reference
[ "write", "graph", "reference" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/h3/io/OutRawH3Impl.java#L392-L399
43,657
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/PathImpl.java
PathImpl.lookup
public final PathImpl lookup(URL url) { String name = URLDecoder.decode(url.toString()); return lookup(name, null); }
java
public final PathImpl lookup(URL url) { String name = URLDecoder.decode(url.toString()); return lookup(name, null); }
[ "public", "final", "PathImpl", "lookup", "(", "URL", "url", ")", "{", "String", "name", "=", "URLDecoder", ".", "decode", "(", "url", ".", "toString", "(", ")", ")", ";", "return", "lookup", "(", "name", ",", "null", ")", ";", "}" ]
Looks up a path by a URL.
[ "Looks", "up", "a", "path", "by", "a", "URL", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L166-L171
43,658
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/PathImpl.java
PathImpl.lookupRelativeNativePath
public String lookupRelativeNativePath(PathImpl path) { String thisNative = getNativePath(); String pathNative = path.getNativePath(); if (pathNative.startsWith(thisNative)) { int i = thisNative.length(); while (i < pathNative.length()) { if (pathNative.charAt(i) != getFileSeparatorC...
java
public String lookupRelativeNativePath(PathImpl path) { String thisNative = getNativePath(); String pathNative = path.getNativePath(); if (pathNative.startsWith(thisNative)) { int i = thisNative.length(); while (i < pathNative.length()) { if (pathNative.charAt(i) != getFileSeparatorC...
[ "public", "String", "lookupRelativeNativePath", "(", "PathImpl", "path", ")", "{", "String", "thisNative", "=", "getNativePath", "(", ")", ";", "String", "pathNative", "=", "path", ".", "getNativePath", "(", ")", ";", "if", "(", "pathNative", ".", "startsWith"...
Returns a native path relative to this native path if the passed path is relative to this path, or an absolute path if the passed path is not relative to this path.
[ "Returns", "a", "native", "path", "relative", "to", "this", "native", "path", "if", "the", "passed", "path", "is", "relative", "to", "this", "path", "or", "an", "absolute", "path", "if", "the", "passed", "path", "is", "not", "relative", "to", "this", "pa...
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L344-L363
43,659
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/PathImpl.java
PathImpl.getResources
public ArrayList<PathImpl> getResources(String name) { ArrayList<PathImpl> list = new ArrayList<PathImpl>(); PathImpl path = lookup(name); if (path.exists()) list.add(path); return list; }
java
public ArrayList<PathImpl> getResources(String name) { ArrayList<PathImpl> list = new ArrayList<PathImpl>(); PathImpl path = lookup(name); if (path.exists()) list.add(path); return list; }
[ "public", "ArrayList", "<", "PathImpl", ">", "getResources", "(", "String", "name", ")", "{", "ArrayList", "<", "PathImpl", ">", "list", "=", "new", "ArrayList", "<", "PathImpl", ">", "(", ")", ";", "PathImpl", "path", "=", "lookup", "(", "name", ")", ...
Looks up all the resources matching a name. (Generally only useful with MergePath.
[ "Looks", "up", "all", "the", "resources", "matching", "a", "name", ".", "(", "Generally", "only", "useful", "with", "MergePath", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L369-L377
43,660
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/PathImpl.java
PathImpl.getResources
public ArrayList<PathImpl> getResources() { ArrayList<PathImpl> list = new ArrayList<PathImpl>(); //if (exists()) list.add(this); return list; }
java
public ArrayList<PathImpl> getResources() { ArrayList<PathImpl> list = new ArrayList<PathImpl>(); //if (exists()) list.add(this); return list; }
[ "public", "ArrayList", "<", "PathImpl", ">", "getResources", "(", ")", "{", "ArrayList", "<", "PathImpl", ">", "list", "=", "new", "ArrayList", "<", "PathImpl", ">", "(", ")", ";", "//if (exists())", "list", ".", "add", "(", "this", ")", ";", "return", ...
Looks up all the existing resources. (Generally only useful with MergePath.
[ "Looks", "up", "all", "the", "existing", "resources", ".", "(", "Generally", "only", "useful", "with", "MergePath", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L383-L391
43,661
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/PathImpl.java
PathImpl.scanScheme
protected String scanScheme(String uri) { int i = 0; if (uri == null) return null; int length = uri.length(); if (length == 0) return null; int ch = uri.charAt(0); if (ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z') { for (i = 1; i < length; i++) { ch = ur...
java
protected String scanScheme(String uri) { int i = 0; if (uri == null) return null; int length = uri.length(); if (length == 0) return null; int ch = uri.charAt(0); if (ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z') { for (i = 1; i < length; i++) { ch = ur...
[ "protected", "String", "scanScheme", "(", "String", "uri", ")", "{", "int", "i", "=", "0", ";", "if", "(", "uri", "==", "null", ")", "return", "null", ";", "int", "length", "=", "uri", ".", "length", "(", ")", ";", "if", "(", "length", "==", "0",...
Returns the scheme portion of a uri. Since schemes are case-insensitive, normalize them to lower case.
[ "Returns", "the", "scheme", "portion", "of", "a", "uri", ".", "Since", "schemes", "are", "case", "-", "insensitive", "normalize", "them", "to", "lower", "case", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L405-L433
43,662
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/PathImpl.java
PathImpl.isWindowsInsecure
public boolean isWindowsInsecure() { String lower = getPath().toLowerCase(Locale.ENGLISH); int lastCh; if ((lastCh = lower.charAt(lower.length() - 1)) == '.' || lastCh == ' ' || lastCh == '*' || lastCh == '?' || ((lastCh == '/' || lastCh == '\\') && ! isDirectory()) || lower.ends...
java
public boolean isWindowsInsecure() { String lower = getPath().toLowerCase(Locale.ENGLISH); int lastCh; if ((lastCh = lower.charAt(lower.length() - 1)) == '.' || lastCh == ' ' || lastCh == '*' || lastCh == '?' || ((lastCh == '/' || lastCh == '\\') && ! isDirectory()) || lower.ends...
[ "public", "boolean", "isWindowsInsecure", "(", ")", "{", "String", "lower", "=", "getPath", "(", ")", ".", "toLowerCase", "(", "Locale", ".", "ENGLISH", ")", ";", "int", "lastCh", ";", "if", "(", "(", "lastCh", "=", "lower", ".", "charAt", "(", "lower"...
Returns true for windows security issues.
[ "Returns", "true", "for", "windows", "security", "issues", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L579-L604
43,663
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/PathImpl.java
PathImpl.iterator
public Iterator<String> iterator() throws IOException { String list[] = list(); // Avoids NPE when subclasses override list() and // possibly return null, e.g. JarPath. if (list == null) list = new String[0]; return new ArrayIterator(list); }
java
public Iterator<String> iterator() throws IOException { String list[] = list(); // Avoids NPE when subclasses override list() and // possibly return null, e.g. JarPath. if (list == null) list = new String[0]; return new ArrayIterator(list); }
[ "public", "Iterator", "<", "String", ">", "iterator", "(", ")", "throws", "IOException", "{", "String", "list", "[", "]", "=", "list", "(", ")", ";", "// Avoids NPE when subclasses override list() and", "// possibly return null, e.g. JarPath.", "if", "(", "list", "=...
Returns a jdk1.2 Iterator for the contents of this directory.
[ "Returns", "a", "jdk1", ".", "2", "Iterator", "for", "the", "contents", "of", "this", "directory", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L982-L992
43,664
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/PathImpl.java
PathImpl.removeAll
public boolean removeAll() throws IOException { if (isDirectory() && ! isLink()) { String []list = list(); for (int i = 0; i < list.length; i++) { PathImpl subpath = lookup(list[i]); subpath.removeAll(); } } return remove(); }
java
public boolean removeAll() throws IOException { if (isDirectory() && ! isLink()) { String []list = list(); for (int i = 0; i < list.length; i++) { PathImpl subpath = lookup(list[i]); subpath.removeAll(); } } return remove(); }
[ "public", "boolean", "removeAll", "(", ")", "throws", "IOException", "{", "if", "(", "isDirectory", "(", ")", "&&", "!", "isLink", "(", ")", ")", "{", "String", "[", "]", "list", "=", "list", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", ...
Removes the all files and directories below this path. @return true if successful.
[ "Removes", "the", "all", "files", "and", "directories", "below", "this", "path", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L1027-L1039
43,665
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/PathImpl.java
PathImpl.createNewFile
public boolean createNewFile() throws IOException { synchronized (LOCK) { if (! exists()) { clearStatusCache(); WriteStreamOld s = openWrite(); s.close(); return true; } } return false; }
java
public boolean createNewFile() throws IOException { synchronized (LOCK) { if (! exists()) { clearStatusCache(); WriteStreamOld s = openWrite(); s.close(); return true; } } return false; }
[ "public", "boolean", "createNewFile", "(", ")", "throws", "IOException", "{", "synchronized", "(", "LOCK", ")", "{", "if", "(", "!", "exists", "(", ")", ")", "{", "clearStatusCache", "(", ")", ";", "WriteStreamOld", "s", "=", "openWrite", "(", ")", ";", ...
Creates the file named by this Path and returns true if the file is new.
[ "Creates", "the", "file", "named", "by", "this", "Path", "and", "returns", "true", "if", "the", "file", "is", "new", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L1309-L1321
43,666
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/PathImpl.java
PathImpl.getCrc64
public long getCrc64() { try { if (isDirectory()) { String []list = list(); long digest = 0x1; for (int i = 0; i < list.length; i++) { digest = Crc64.generate(digest, list[i]); } return digest; } else if (canRead()) { ReadStreamOld is ...
java
public long getCrc64() { try { if (isDirectory()) { String []list = list(); long digest = 0x1; for (int i = 0; i < list.length; i++) { digest = Crc64.generate(digest, list[i]); } return digest; } else if (canRead()) { ReadStreamOld is ...
[ "public", "long", "getCrc64", "(", ")", "{", "try", "{", "if", "(", "isDirectory", "(", ")", ")", "{", "String", "[", "]", "list", "=", "list", "(", ")", ";", "long", "digest", "=", "0x1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<",...
Returns the crc64 code.
[ "Returns", "the", "crc64", "code", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L1483-L1524
43,667
baratine/baratine
kraken/src/main/java/com/caucho/v5/kelp/JournalKelpImpl.java
JournalKelpImpl.put
void put(RowCursor cursor) { boolean isValid; do { isValid = true; try (JournalOutputStream os = openItem()) { os.write(CODE_PUT); cursor.writeJournal(os); isValid = os.complete(); } catch (IOException e) { log.log(Level.FINER, e.toStri...
java
void put(RowCursor cursor) { boolean isValid; do { isValid = true; try (JournalOutputStream os = openItem()) { os.write(CODE_PUT); cursor.writeJournal(os); isValid = os.complete(); } catch (IOException e) { log.log(Level.FINER, e.toStri...
[ "void", "put", "(", "RowCursor", "cursor", ")", "{", "boolean", "isValid", ";", "do", "{", "isValid", "=", "true", ";", "try", "(", "JournalOutputStream", "os", "=", "openItem", "(", ")", ")", "{", "os", ".", "write", "(", "CODE_PUT", ")", ";", "curs...
Writes the put to the journal.
[ "Writes", "the", "put", "to", "the", "journal", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/JournalKelpImpl.java#L103-L120
43,668
baratine/baratine
kraken/src/main/java/com/caucho/v5/kelp/JournalKelpImpl.java
JournalKelpImpl.remove
void remove(RowCursor cursor) { boolean isValid; do { isValid = true; try (JournalOutputStream os = openItem()) { os.write(CODE_REMOVE); cursor.getKey(_buffer, 0); os.write(_buffer, 0, getKeyLength()); try { BitsUtil.writeLong(os, c...
java
void remove(RowCursor cursor) { boolean isValid; do { isValid = true; try (JournalOutputStream os = openItem()) { os.write(CODE_REMOVE); cursor.getKey(_buffer, 0); os.write(_buffer, 0, getKeyLength()); try { BitsUtil.writeLong(os, c...
[ "void", "remove", "(", "RowCursor", "cursor", ")", "{", "boolean", "isValid", ";", "do", "{", "isValid", "=", "true", ";", "try", "(", "JournalOutputStream", "os", "=", "openItem", "(", ")", ")", "{", "os", ".", "write", "(", "CODE_REMOVE", ")", ";", ...
Writes the remove to the journal.
[ "Writes", "the", "remove", "to", "the", "journal", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/JournalKelpImpl.java#L125-L147
43,669
SeaCloudsEU/SeaCloudsPlatform
sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/Tower4CloudsTranslator.java
Tower4CloudsTranslator.initTermsMap
private MultivaluedMapWrapper<String, IGuaranteeTerm> initTermsMap(IAgreement agreement) { MultivaluedMapWrapper<String, IGuaranteeTerm> result = new MultivaluedMapWrapper<String, IGuaranteeTerm>(); for (IGuaranteeTerm term : agreement.getGuaranteeTerms()) { String variable = co...
java
private MultivaluedMapWrapper<String, IGuaranteeTerm> initTermsMap(IAgreement agreement) { MultivaluedMapWrapper<String, IGuaranteeTerm> result = new MultivaluedMapWrapper<String, IGuaranteeTerm>(); for (IGuaranteeTerm term : agreement.getGuaranteeTerms()) { String variable = co...
[ "private", "MultivaluedMapWrapper", "<", "String", ",", "IGuaranteeTerm", ">", "initTermsMap", "(", "IAgreement", "agreement", ")", "{", "MultivaluedMapWrapper", "<", "String", ",", "IGuaranteeTerm", ">", "result", "=", "new", "MultivaluedMapWrapper", "<", "String", ...
Inits a MultivaluedMap with metrickey as key and the terms that evaluate the metrickey as values. @param agreement @return
[ "Inits", "a", "MultivaluedMap", "with", "metrickey", "as", "key", "and", "the", "terms", "that", "evaluate", "the", "metrickey", "as", "values", "." ]
b199fe6de2c63b808cb248d3aca947d802375df8
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/Tower4CloudsTranslator.java#L103-L111
43,670
baratine/baratine
web/src/main/java/com/caucho/v5/jni/JniServerSocketImpl.java
JniServerSocketImpl.accept
@Override public boolean accept(SocketBar socket) throws IOException { JniSocketImpl jniSocket = (JniSocketImpl) socket; if (_fd == 0) throw new IOException("accept from closed socket"); return jniSocket.accept(this, _fd, _socketTimeout); }
java
@Override public boolean accept(SocketBar socket) throws IOException { JniSocketImpl jniSocket = (JniSocketImpl) socket; if (_fd == 0) throw new IOException("accept from closed socket"); return jniSocket.accept(this, _fd, _socketTimeout); }
[ "@", "Override", "public", "boolean", "accept", "(", "SocketBar", "socket", ")", "throws", "IOException", "{", "JniSocketImpl", "jniSocket", "=", "(", "JniSocketImpl", ")", "socket", ";", "if", "(", "_fd", "==", "0", ")", "throw", "new", "IOException", "(", ...
Accepts a new connection from the socket. @param socket the socket connection structure @return true if the accept returns a new socket.
[ "Accepts", "a", "new", "connection", "from", "the", "socket", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/jni/JniServerSocketImpl.java#L306-L316
43,671
baratine/baratine
core/src/main/java/com/caucho/v5/amp/thread/ThreadPoolBase.java
ThreadPoolBase.setIdleMax
public void setIdleMax(int idleMax) { if (idleMax <= _idleMin) { throw new IllegalArgumentException(L.l("idle-max '{0}' must be greater than idle-min '{1}'.", idleMax, _idleMin)); } _launcher.setIdleMax(_idleMax); }
java
public void setIdleMax(int idleMax) { if (idleMax <= _idleMin) { throw new IllegalArgumentException(L.l("idle-max '{0}' must be greater than idle-min '{1}'.", idleMax, _idleMin)); } _launcher.setIdleMax(_idleMax); }
[ "public", "void", "setIdleMax", "(", "int", "idleMax", ")", "{", "if", "(", "idleMax", "<=", "_idleMin", ")", "{", "throw", "new", "IllegalArgumentException", "(", "L", ".", "l", "(", "\"idle-max '{0}' must be greater than idle-min '{1}'.\"", ",", "idleMax", ",", ...
Returns the thread idle max.
[ "Returns", "the", "thread", "idle", "max", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/thread/ThreadPoolBase.java#L235-L243
43,672
baratine/baratine
core/src/main/java/com/caucho/v5/amp/thread/ThreadPoolBase.java
ThreadPoolBase.schedule
public boolean schedule(Runnable task) { ClassLoader loader = Thread.currentThread().getContextClassLoader(); boolean isPriority = false; boolean isQueue = true; boolean isWake = true; return scheduleImpl(task, loader, MAX_EXPIRE, isPriority, isQueue, isWake); }
java
public boolean schedule(Runnable task) { ClassLoader loader = Thread.currentThread().getContextClassLoader(); boolean isPriority = false; boolean isQueue = true; boolean isWake = true; return scheduleImpl(task, loader, MAX_EXPIRE, isPriority, isQueue, isWake); }
[ "public", "boolean", "schedule", "(", "Runnable", "task", ")", "{", "ClassLoader", "loader", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "boolean", "isPriority", "=", "false", ";", "boolean", "isQueue", "=", "t...
Schedules a new task.
[ "Schedules", "a", "new", "task", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/thread/ThreadPoolBase.java#L474-L483
43,673
baratine/baratine
core/src/main/java/com/caucho/v5/amp/thread/ThreadPoolBase.java
ThreadPoolBase.wakeThreads
private void wakeThreads(int count) { while (true) { int taskCount = Math.max(0, _taskCount.get()); int spinIdleCount = _spinIdleCount.get(); long threadWakeHead = _threadWakeHead.get(); long threadWakeTail = _threadWakeTail.get(); long threadCount = spinIdleCount + threadW...
java
private void wakeThreads(int count) { while (true) { int taskCount = Math.max(0, _taskCount.get()); int spinIdleCount = _spinIdleCount.get(); long threadWakeHead = _threadWakeHead.get(); long threadWakeTail = _threadWakeTail.get(); long threadCount = spinIdleCount + threadW...
[ "private", "void", "wakeThreads", "(", "int", "count", ")", "{", "while", "(", "true", ")", "{", "int", "taskCount", "=", "Math", ".", "max", "(", "0", ",", "_taskCount", ".", "get", "(", ")", ")", ";", "int", "spinIdleCount", "=", "_spinIdleCount", ...
wake enough threads to process the tasks
[ "wake", "enough", "threads", "to", "process", "the", "tasks" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/thread/ThreadPoolBase.java#L828-L862
43,674
baratine/baratine
core/src/main/java/com/caucho/v5/amp/thread/ThreadPoolBase.java
ThreadPoolBase.clearIdleThreads
public void clearIdleThreads() { _launcher.resetThrottle(); int idleCount = _idleThreadRing.size(); ThreadAmp thread; while (idleCount-- > 0 && (thread = _idleThreadRing.poll()) != null) { thread.close(); } }
java
public void clearIdleThreads() { _launcher.resetThrottle(); int idleCount = _idleThreadRing.size(); ThreadAmp thread; while (idleCount-- > 0 && (thread = _idleThreadRing.poll()) != null) { thread.close(); } }
[ "public", "void", "clearIdleThreads", "(", ")", "{", "_launcher", ".", "resetThrottle", "(", ")", ";", "int", "idleCount", "=", "_idleThreadRing", ".", "size", "(", ")", ";", "ThreadAmp", "thread", ";", "while", "(", "idleCount", "--", ">", "0", "&&", "(...
interrupts all the idle threads.
[ "interrupts", "all", "the", "idle", "threads", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/thread/ThreadPoolBase.java#L919-L930
43,675
baratine/baratine
core/src/main/java/com/caucho/v5/amp/inbox/InboxQueue.java
InboxQueue.start
@Override public void start() { if (_lifecycle.isActive()) { return; } synchronized (_lifecycle) { if (! _lifecycle.toInit()) { return; } init(_stubMain); } start(_stubMain); }
java
@Override public void start() { if (_lifecycle.isActive()) { return; } synchronized (_lifecycle) { if (! _lifecycle.toInit()) { return; } init(_stubMain); } start(_stubMain); }
[ "@", "Override", "public", "void", "start", "(", ")", "{", "if", "(", "_lifecycle", ".", "isActive", "(", ")", ")", "{", "return", ";", "}", "synchronized", "(", "_lifecycle", ")", "{", "if", "(", "!", "_lifecycle", ".", "toInit", "(", ")", ")", "{...
Start is called lazily when a service is first used.
[ "Start", "is", "called", "lazily", "when", "a", "service", "is", "first", "used", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/inbox/InboxQueue.java#L194-L210
43,676
baratine/baratine
core/src/main/java/com/caucho/v5/amp/inbox/InboxQueue.java
InboxQueue.init
private void init(StubAmp stub) { //BuildMessageAmp buildMessage = new BuildMessageAmp(this); OnInitMessage onInitMsg = new OnInitMessage(this); _queue.offer(onInitMsg); _queue.wake(); }
java
private void init(StubAmp stub) { //BuildMessageAmp buildMessage = new BuildMessageAmp(this); OnInitMessage onInitMsg = new OnInitMessage(this); _queue.offer(onInitMsg); _queue.wake(); }
[ "private", "void", "init", "(", "StubAmp", "stub", ")", "{", "//BuildMessageAmp buildMessage = new BuildMessageAmp(this);", "OnInitMessage", "onInitMsg", "=", "new", "OnInitMessage", "(", "this", ")", ";", "_queue", ".", "offer", "(", "onInitMsg", ")", ";", "_queue"...
Init calls the @OnInit methods.
[ "Init", "calls", "the" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/inbox/InboxQueue.java#L230-L238
43,677
baratine/baratine
core/src/main/java/com/caucho/v5/amp/inbox/InboxQueue.java
InboxQueue.shutdown
@Override public void shutdown(ShutdownModeAmp mode) { if (! _lifecycle.toStopping()) { return; } _lifecycle.toDestroy(); OnShutdownMessage shutdownMessage = new OnShutdownMessage(this, mode, isSingle()); _queue.offer(shutdownMessage); // _queue.close(); /* ...
java
@Override public void shutdown(ShutdownModeAmp mode) { if (! _lifecycle.toStopping()) { return; } _lifecycle.toDestroy(); OnShutdownMessage shutdownMessage = new OnShutdownMessage(this, mode, isSingle()); _queue.offer(shutdownMessage); // _queue.close(); /* ...
[ "@", "Override", "public", "void", "shutdown", "(", "ShutdownModeAmp", "mode", ")", "{", "if", "(", "!", "_lifecycle", ".", "toStopping", "(", ")", ")", "{", "return", ";", "}", "_lifecycle", ".", "toDestroy", "(", ")", ";", "OnShutdownMessage", "shutdownM...
Closes the inbox
[ "Closes", "the", "inbox" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/amp/inbox/InboxQueue.java#L509-L550
43,678
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.setLocalTime
public void setLocalTime(long time) { // If this is a local time zone date, just set the time if (_timeZone != _gmtTimeZone) { calculateSplit(time); } // If this is a GMT date, convert from local to GMT else { calculateSplit(time - _localTimeZone.getRawOffset()); try { l...
java
public void setLocalTime(long time) { // If this is a local time zone date, just set the time if (_timeZone != _gmtTimeZone) { calculateSplit(time); } // If this is a GMT date, convert from local to GMT else { calculateSplit(time - _localTimeZone.getRawOffset()); try { l...
[ "public", "void", "setLocalTime", "(", "long", "time", ")", "{", "// If this is a local time zone date, just set the time", "if", "(", "_timeZone", "!=", "_gmtTimeZone", ")", "{", "calculateSplit", "(", "time", ")", ";", "}", "// If this is a GMT date, convert from local ...
Sets the time in milliseconds since the epoch and calculate the internal variables.
[ "Sets", "the", "time", "in", "milliseconds", "since", "the", "epoch", "and", "calculate", "the", "internal", "variables", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L284-L307
43,679
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.getLocalTime
public long getLocalTime() { // If this is a local time zone date, just set the time if (_timeZone != _gmtTimeZone) { return _localTimeOfEpoch; } // If this is a GMT date, convert from local to GMT else { long offset = _localTimeZone.getOffset(GregorianCalendar.AD, ...
java
public long getLocalTime() { // If this is a local time zone date, just set the time if (_timeZone != _gmtTimeZone) { return _localTimeOfEpoch; } // If this is a GMT date, convert from local to GMT else { long offset = _localTimeZone.getOffset(GregorianCalendar.AD, ...
[ "public", "long", "getLocalTime", "(", ")", "{", "// If this is a local time zone date, just set the time", "if", "(", "_timeZone", "!=", "_gmtTimeZone", ")", "{", "return", "_localTimeOfEpoch", ";", "}", "// If this is a GMT date, convert from local to GMT", "else", "{", "...
Returns the time in milliseconds since the epoch.
[ "Returns", "the", "time", "in", "milliseconds", "since", "the", "epoch", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L312-L329
43,680
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.setMonth
public void setMonth(int month) { if (month < 0 || DAYS_IN_MONTH.length <= month) return; _month = month; if (DAYS_IN_MONTH[month] <= _dayOfMonth) _dayOfMonth = DAYS_IN_MONTH[month] - 1; calculateJoin(); calculateSplit(_localTimeOfEpoch); }
java
public void setMonth(int month) { if (month < 0 || DAYS_IN_MONTH.length <= month) return; _month = month; if (DAYS_IN_MONTH[month] <= _dayOfMonth) _dayOfMonth = DAYS_IN_MONTH[month] - 1; calculateJoin(); calculateSplit(_localTimeOfEpoch); }
[ "public", "void", "setMonth", "(", "int", "month", ")", "{", "if", "(", "month", "<", "0", "||", "DAYS_IN_MONTH", ".", "length", "<=", "month", ")", "return", ";", "_month", "=", "month", ";", "if", "(", "DAYS_IN_MONTH", "[", "month", "]", "<=", "_da...
Sets the month in the year.
[ "Sets", "the", "month", "in", "the", "year", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L394-L406
43,681
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.getWeek
public int getWeek() { int dow4th = (int) ((_dayOfEpoch - _dayOfYear + 3) % 7 + 10) % 7; int ww1monday = 3 - dow4th; if (_dayOfYear < ww1monday) return 53; int week = (_dayOfYear - ww1monday) / 7 + 1; if (_dayOfYear >= 360) { int days = 365 + (_isLeapYear ? 1 : 0); long nextNe...
java
public int getWeek() { int dow4th = (int) ((_dayOfEpoch - _dayOfYear + 3) % 7 + 10) % 7; int ww1monday = 3 - dow4th; if (_dayOfYear < ww1monday) return 53; int week = (_dayOfYear - ww1monday) / 7 + 1; if (_dayOfYear >= 360) { int days = 365 + (_isLeapYear ? 1 : 0); long nextNe...
[ "public", "int", "getWeek", "(", ")", "{", "int", "dow4th", "=", "(", "int", ")", "(", "(", "_dayOfEpoch", "-", "_dayOfYear", "+", "3", ")", "%", "7", "+", "10", ")", "%", "7", ";", "int", "ww1monday", "=", "3", "-", "dow4th", ";", "if", "(", ...
Returns the week in the year.
[ "Returns", "the", "week", "in", "the", "year", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L564-L586
43,682
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.get
public long get(int field) { switch (field) { case TIME: return getLocalTime(); case YEAR: return getYear(); case MONTH: return getMonth(); case DAY_OF_MONTH: return getDayOfMonth(); case DAY: return getDayOfWeek(); case DAY_OF_WEEK: return getDayOf...
java
public long get(int field) { switch (field) { case TIME: return getLocalTime(); case YEAR: return getYear(); case MONTH: return getMonth(); case DAY_OF_MONTH: return getDayOfMonth(); case DAY: return getDayOfWeek(); case DAY_OF_WEEK: return getDayOf...
[ "public", "long", "get", "(", "int", "field", ")", "{", "switch", "(", "field", ")", "{", "case", "TIME", ":", "return", "getLocalTime", "(", ")", ";", "case", "YEAR", ":", "return", "getYear", "(", ")", ";", "case", "MONTH", ":", "return", "getMonth...
Gets values based on a field.
[ "Gets", "values", "based", "on", "a", "field", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L591-L630
43,683
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.set
public long set(int field, long value) { switch (field) { case YEAR: setYear((int) value); break; case MONTH: setMonth((int) value); break; case DAY_OF_MONTH: setDayOfMonth((int) value); break; case HOUR: setHour((int) value); break; case MIN...
java
public long set(int field, long value) { switch (field) { case YEAR: setYear((int) value); break; case MONTH: setMonth((int) value); break; case DAY_OF_MONTH: setDayOfMonth((int) value); break; case HOUR: setHour((int) value); break; case MIN...
[ "public", "long", "set", "(", "int", "field", ",", "long", "value", ")", "{", "switch", "(", "field", ")", "{", "case", "YEAR", ":", "setYear", "(", "(", "int", ")", "value", ")", ";", "break", ";", "case", "MONTH", ":", "setMonth", "(", "(", "in...
Sets values based on a field.
[ "Sets", "values", "based", "on", "a", "field", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L635-L671
43,684
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.printDate
public void printDate(WriteStreamOld os) throws IOException { os.print(DAY_NAMES[(int) (_dayOfEpoch % 7 + 11) % 7]); os.write(','); os.write(' '); os.print((_dayOfMonth + 1) / 10); os.print((_dayOfMonth + 1) % 10); os.write(' '); os.print(MONTH_NAMES[(int) _month]); os.write(' '); ...
java
public void printDate(WriteStreamOld os) throws IOException { os.print(DAY_NAMES[(int) (_dayOfEpoch % 7 + 11) % 7]); os.write(','); os.write(' '); os.print((_dayOfMonth + 1) / 10); os.print((_dayOfMonth + 1) % 10); os.write(' '); os.print(MONTH_NAMES[(int) _month]); os.write(' '); ...
[ "public", "void", "printDate", "(", "WriteStreamOld", "os", ")", "throws", "IOException", "{", "os", ".", "print", "(", "DAY_NAMES", "[", "(", "int", ")", "(", "_dayOfEpoch", "%", "7", "+", "11", ")", "%", "7", "]", ")", ";", "os", ".", "write", "(...
Prints the date to a stream.
[ "Prints", "the", "date", "to", "a", "stream", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L740-L787
43,685
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.printISO8601
public String printISO8601() { StringBuilder sb = new StringBuilder(); if (_year > 0) { sb.append((_year / 1000) % 10); sb.append((_year / 100) % 10); sb.append((_year / 10) % 10); sb.append(_year % 10); sb.append('-'); sb.append(((_month + 1) / 10) % 10); sb.append(...
java
public String printISO8601() { StringBuilder sb = new StringBuilder(); if (_year > 0) { sb.append((_year / 1000) % 10); sb.append((_year / 100) % 10); sb.append((_year / 10) % 10); sb.append(_year % 10); sb.append('-'); sb.append(((_month + 1) / 10) % 10); sb.append(...
[ "public", "String", "printISO8601", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "_year", ">", "0", ")", "{", "sb", ".", "append", "(", "(", "_year", "/", "1000", ")", "%", "10", ")", ";", "sb", "."...
Prints the time in ISO 8601
[ "Prints", "the", "time", "in", "ISO", "8601" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L829-L889
43,686
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.printISO8601Date
public String printISO8601Date() { CharBuffer cb = new CharBuffer(); if (_year > 0) { cb.append((_year / 1000) % 10); cb.append((_year / 100) % 10); cb.append((_year / 10) % 10); cb.append(_year % 10); cb.append('-'); cb.append(((_month + 1) / 10) % 10); cb.append((_...
java
public String printISO8601Date() { CharBuffer cb = new CharBuffer(); if (_year > 0) { cb.append((_year / 1000) % 10); cb.append((_year / 100) % 10); cb.append((_year / 10) % 10); cb.append(_year % 10); cb.append('-'); cb.append(((_month + 1) / 10) % 10); cb.append((_...
[ "public", "String", "printISO8601Date", "(", ")", "{", "CharBuffer", "cb", "=", "new", "CharBuffer", "(", ")", ";", "if", "(", "_year", ">", "0", ")", "{", "cb", ".", "append", "(", "(", "_year", "/", "1000", ")", "%", "10", ")", ";", "cb", ".", ...
Prints just the date component of ISO 8601
[ "Prints", "just", "the", "date", "component", "of", "ISO", "8601" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L894-L912
43,687
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.formatGMT
public synchronized static String formatGMT(long gmtTime, String format) { _gmtDate.setGMTTime(gmtTime); return _gmtDate.format(new CharBuffer(), format).toString(); }
java
public synchronized static String formatGMT(long gmtTime, String format) { _gmtDate.setGMTTime(gmtTime); return _gmtDate.format(new CharBuffer(), format).toString(); }
[ "public", "synchronized", "static", "String", "formatGMT", "(", "long", "gmtTime", ",", "String", "format", ")", "{", "_gmtDate", ".", "setGMTTime", "(", "gmtTime", ")", ";", "return", "_gmtDate", ".", "format", "(", "new", "CharBuffer", "(", ")", ",", "fo...
Formats a date. @param time the time to format @param format the format string
[ "Formats", "a", "date", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L920-L925
43,688
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.format
public String format(String format) { CharBuffer cb = new CharBuffer(); return format(cb, format).close(); }
java
public String format(String format) { CharBuffer cb = new CharBuffer(); return format(cb, format).close(); }
[ "public", "String", "format", "(", "String", "format", ")", "{", "CharBuffer", "cb", "=", "new", "CharBuffer", "(", ")", ";", "return", "format", "(", "cb", ",", "format", ")", ".", "close", "(", ")", ";", "}" ]
Formats the current date.
[ "Formats", "the", "current", "date", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L1000-L1005
43,689
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.yearToDayOfEpoch
private long yearToDayOfEpoch(long year) { if (year > 0) { year -= 1601; return (365 * year + year / 4 - year / 100 + year / 400 - ((1970 - 1601) * 365 + (1970 - 1601) / 4 - 3)); } else { year = 2000 - year; return ((2000 - 1970) * 365 + (2000 - 1970) / 4 - ...
java
private long yearToDayOfEpoch(long year) { if (year > 0) { year -= 1601; return (365 * year + year / 4 - year / 100 + year / 400 - ((1970 - 1601) * 365 + (1970 - 1601) / 4 - 3)); } else { year = 2000 - year; return ((2000 - 1970) * 365 + (2000 - 1970) / 4 - ...
[ "private", "long", "yearToDayOfEpoch", "(", "long", "year", ")", "{", "if", "(", "year", ">", "0", ")", "{", "year", "-=", "1601", ";", "return", "(", "365", "*", "year", "+", "year", "/", "4", "-", "year", "/", "100", "+", "year", "/", "400", ...
Based on the year, return the number of days since the epoch.
[ "Based", "on", "the", "year", "return", "the", "number", "of", "days", "since", "the", "epoch", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L1563-L1575
43,690
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.monthToDayOfYear
private long monthToDayOfYear(long month, boolean isLeapYear) { long day = 0; for (int i = 0; i < month && i < 12; i++) { day += DAYS_IN_MONTH[i]; if (i == 1 && isLeapYear) day++; } return day; }
java
private long monthToDayOfYear(long month, boolean isLeapYear) { long day = 0; for (int i = 0; i < month && i < 12; i++) { day += DAYS_IN_MONTH[i]; if (i == 1 && isLeapYear) day++; } return day; }
[ "private", "long", "monthToDayOfYear", "(", "long", "month", ",", "boolean", "isLeapYear", ")", "{", "long", "day", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "month", "&&", "i", "<", "12", ";", "i", "++", ")", "{", "day", ...
Calculates the day of the year for the beginning of the month.
[ "Calculates", "the", "day", "of", "the", "year", "for", "the", "beginning", "of", "the", "month", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L1580-L1591
43,691
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.setDate
public long setDate(long year, long month, long day) { year += (long) Math.floor(month / 12.0); month -= (long) 12 * Math.floor(month / 12.0); _year = year; _month = month; _dayOfMonth = day - 1; calculateJoin(); calculateSplit(_localTimeOfEpoch); return _localTimeOfEpoch; }
java
public long setDate(long year, long month, long day) { year += (long) Math.floor(month / 12.0); month -= (long) 12 * Math.floor(month / 12.0); _year = year; _month = month; _dayOfMonth = day - 1; calculateJoin(); calculateSplit(_localTimeOfEpoch); return _localTimeOfEpoch; }
[ "public", "long", "setDate", "(", "long", "year", ",", "long", "month", ",", "long", "day", ")", "{", "year", "+=", "(", "long", ")", "Math", ".", "floor", "(", "month", "/", "12.0", ")", ";", "month", "-=", "(", "long", ")", "12", "*", "Math", ...
Sets date in the local time. @param year @param month where January = 0 @param day day of month where the 1st = 1
[ "Sets", "date", "in", "the", "local", "time", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L1689-L1702
43,692
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.calculateSplit
private void calculateSplit(long localTime) { _localTimeOfEpoch = localTime; _dayOfEpoch = divFloor(_localTimeOfEpoch, MS_PER_DAY); _timeOfDay = _localTimeOfEpoch - MS_PER_DAY * _dayOfEpoch; calculateYear(); calculateMonth(); _hour = _timeOfDay / 3600000; _minute = _timeOfDay / 60000 % 6...
java
private void calculateSplit(long localTime) { _localTimeOfEpoch = localTime; _dayOfEpoch = divFloor(_localTimeOfEpoch, MS_PER_DAY); _timeOfDay = _localTimeOfEpoch - MS_PER_DAY * _dayOfEpoch; calculateYear(); calculateMonth(); _hour = _timeOfDay / 3600000; _minute = _timeOfDay / 60000 % 6...
[ "private", "void", "calculateSplit", "(", "long", "localTime", ")", "{", "_localTimeOfEpoch", "=", "localTime", ";", "_dayOfEpoch", "=", "divFloor", "(", "_localTimeOfEpoch", ",", "MS_PER_DAY", ")", ";", "_timeOfDay", "=", "_localTimeOfEpoch", "-", "MS_PER_DAY", "...
Calculate and set the calendar components based on the given time. @param localTime local time in milliseconds since the epoch
[ "Calculate", "and", "set", "the", "calendar", "components", "based", "on", "the", "given", "time", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L1722-L1757
43,693
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.calculateYear
private void calculateYear() { long days = _dayOfEpoch; // shift to using 1601 as a base days += (1970 - 1601) * 365 + (1970 - 1601) / 4 - 3; long n400 = divFloor(days, 400 * 365 + 100 - 3); days -= n400 * (400 * 365 + 100 - 3); long n100 = divFloor(days, 100 * 365 + 25 - 1); if (n100 =...
java
private void calculateYear() { long days = _dayOfEpoch; // shift to using 1601 as a base days += (1970 - 1601) * 365 + (1970 - 1601) / 4 - 3; long n400 = divFloor(days, 400 * 365 + 100 - 3); days -= n400 * (400 * 365 + 100 - 3); long n100 = divFloor(days, 100 * 365 + 25 - 1); if (n100 =...
[ "private", "void", "calculateYear", "(", ")", "{", "long", "days", "=", "_dayOfEpoch", ";", "// shift to using 1601 as a base", "days", "+=", "(", "1970", "-", "1601", ")", "*", "365", "+", "(", "1970", "-", "1601", ")", "/", "4", "-", "3", ";", "long"...
Calculates the year, the dayOfYear and whether this is a leap year from the current days since the epoch.
[ "Calculates", "the", "year", "the", "dayOfYear", "and", "whether", "this", "is", "a", "leap", "year", "from", "the", "current", "days", "since", "the", "epoch", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L1763-L1791
43,694
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.calculateMonth
private void calculateMonth() { _dayOfMonth = _dayOfYear; for (_month = 0; _month < 12; _month++) { if (_month == 1 && _isLeapYear) { if (_dayOfMonth < 29) return; else _dayOfMonth -= 29; } else if (_dayOfMonth < DAYS_IN_MONTH[(int) _month]) retur...
java
private void calculateMonth() { _dayOfMonth = _dayOfYear; for (_month = 0; _month < 12; _month++) { if (_month == 1 && _isLeapYear) { if (_dayOfMonth < 29) return; else _dayOfMonth -= 29; } else if (_dayOfMonth < DAYS_IN_MONTH[(int) _month]) retur...
[ "private", "void", "calculateMonth", "(", ")", "{", "_dayOfMonth", "=", "_dayOfYear", ";", "for", "(", "_month", "=", "0", ";", "_month", "<", "12", ";", "_month", "++", ")", "{", "if", "(", "_month", "==", "1", "&&", "_isLeapYear", ")", "{", "if", ...
Calculates the month based on the day of the year.
[ "Calculates", "the", "month", "based", "on", "the", "day", "of", "the", "year", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L1801-L1817
43,695
baratine/baratine
framework/src/main/java/com/caucho/v5/util/QDate.java
QDate.calculateJoin
private long calculateJoin() { _year += divFloor(_month, 12); _month -= 12 * divFloor(_month, 12); _localTimeOfEpoch = MS_PER_DAY * (yearToDayOfEpoch(_year) + monthToDayOfYear(_month, isLeapYear(_year)) + _dayOfMonth); _localTimeOfEpoch += _ms + 1000...
java
private long calculateJoin() { _year += divFloor(_month, 12); _month -= 12 * divFloor(_month, 12); _localTimeOfEpoch = MS_PER_DAY * (yearToDayOfEpoch(_year) + monthToDayOfYear(_month, isLeapYear(_year)) + _dayOfMonth); _localTimeOfEpoch += _ms + 1000...
[ "private", "long", "calculateJoin", "(", ")", "{", "_year", "+=", "divFloor", "(", "_month", ",", "12", ")", ";", "_month", "-=", "12", "*", "divFloor", "(", "_month", ",", "12", ")", ";", "_localTimeOfEpoch", "=", "MS_PER_DAY", "*", "(", "yearToDayOfEpo...
Based on the current data, calculate the time since the epoch. @return time since the epoch, given the calendar components
[ "Based", "on", "the", "current", "data", "calculate", "the", "time", "since", "the", "epoch", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L1824-L1837
43,696
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/BasicDependencyContainer.java
BasicDependencyContainer.logModified
public boolean logModified(Logger log) { for (int i = _dependencyList.size() - 1; i >= 0; i--) { Dependency dependency = _dependencyList.get(i); if (dependency.logModified(log)) return true; } return false; }
java
public boolean logModified(Logger log) { for (int i = _dependencyList.size() - 1; i >= 0; i--) { Dependency dependency = _dependencyList.get(i); if (dependency.logModified(log)) return true; } return false; }
[ "public", "boolean", "logModified", "(", "Logger", "log", ")", "{", "for", "(", "int", "i", "=", "_dependencyList", ".", "size", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "Dependency", "dependency", "=", "_dependencyList", "....
Log the reason for the modification
[ "Log", "the", "reason", "for", "the", "modification" ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/BasicDependencyContainer.java#L187-L197
43,697
baratine/baratine
kraken/src/main/java/com/caucho/v5/kelp/PageServiceImpl.java
PageServiceImpl.getSafe
@Override public void getSafe(RowCursor cursor, Result<Boolean> result) { result.ok(getImpl(cursor)); }
java
@Override public void getSafe(RowCursor cursor, Result<Boolean> result) { result.ok(getImpl(cursor)); }
[ "@", "Override", "public", "void", "getSafe", "(", "RowCursor", "cursor", ",", "Result", "<", "Boolean", ">", "result", ")", "{", "result", ".", "ok", "(", "getImpl", "(", "cursor", ")", ")", ";", "}" ]
Non-peek get.
[ "Non", "-", "peek", "get", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/PageServiceImpl.java#L211-L215
43,698
baratine/baratine
kraken/src/main/java/com/caucho/v5/kelp/PageServiceImpl.java
PageServiceImpl.getStream
@Direct @Override public void getStream(RowCursor cursor, Result<GetStreamResult> result) { long version = cursor.getVersion(); PageLeafImpl leaf = getLeafByCursor(cursor); if (leaf == null) { result.ok(new GetStreamResult(false, null)); return; } ...
java
@Direct @Override public void getStream(RowCursor cursor, Result<GetStreamResult> result) { long version = cursor.getVersion(); PageLeafImpl leaf = getLeafByCursor(cursor); if (leaf == null) { result.ok(new GetStreamResult(false, null)); return; } ...
[ "@", "Direct", "@", "Override", "public", "void", "getStream", "(", "RowCursor", "cursor", ",", "Result", "<", "GetStreamResult", ">", "result", ")", "{", "long", "version", "=", "cursor", ".", "getVersion", "(", ")", ";", "PageLeafImpl", "leaf", "=", "get...
For cluster calls, returns a stream to the new value if the value has changed.
[ "For", "cluster", "calls", "returns", "a", "stream", "to", "the", "new", "value", "if", "the", "value", "has", "changed", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/PageServiceImpl.java#L232-L261
43,699
baratine/baratine
kraken/src/main/java/com/caucho/v5/kelp/PageServiceImpl.java
PageServiceImpl.getSequenceSize
long getSequenceSize(SegmentKelp segment) { int tailPid = _tailPid.get(); long size = 0; for (int i = 0; i <= tailPid; i++) { Page page = _pages.get(i); if (page != null && page.getSegment() == segment) { size += page.size(); } } return size; }
java
long getSequenceSize(SegmentKelp segment) { int tailPid = _tailPid.get(); long size = 0; for (int i = 0; i <= tailPid; i++) { Page page = _pages.get(i); if (page != null && page.getSegment() == segment) { size += page.size(); } } return size; }
[ "long", "getSequenceSize", "(", "SegmentKelp", "segment", ")", "{", "int", "tailPid", "=", "_tailPid", ".", "get", "(", ")", ";", "long", "size", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "tailPid", ";", "i", "++", ")", "{"...
Returns the size in bytes of all pages with the given sequence. Used by the page garbage-collector to determine which segments to collect.
[ "Returns", "the", "size", "in", "bytes", "of", "all", "pages", "with", "the", "given", "sequence", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/PageServiceImpl.java#L603-L618