repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java | KnowledgeSwitchYardScanner.toPropertiesModel | protected PropertiesModel toPropertiesModel(Property[] propertyAnnotations, KnowledgeNamespace knowledgeNamespace) {
if (propertyAnnotations == null || propertyAnnotations.length == 0) {
return null;
}
PropertiesModel propertiesModel = new V1PropertiesModel(knowledgeNamespace.uri());... | java | protected PropertiesModel toPropertiesModel(Property[] propertyAnnotations, KnowledgeNamespace knowledgeNamespace) {
if (propertyAnnotations == null || propertyAnnotations.length == 0) {
return null;
}
PropertiesModel propertiesModel = new V1PropertiesModel(knowledgeNamespace.uri());... | [
"protected",
"PropertiesModel",
"toPropertiesModel",
"(",
"Property",
"[",
"]",
"propertyAnnotations",
",",
"KnowledgeNamespace",
"knowledgeNamespace",
")",
"{",
"if",
"(",
"propertyAnnotations",
"==",
"null",
"||",
"propertyAnnotations",
".",
"length",
"==",
"0",
")"... | Converts property annotations to properties model.
@param propertyAnnotations propertyAnnotations
@param knowledgeNamespace knowledgeNamespace
@return model | [
"Converts",
"property",
"annotations",
"to",
"properties",
"model",
"."
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java#L345-L363 | train |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java | KnowledgeSwitchYardScanner.toResourcesModel | protected ResourcesModel toResourcesModel(Resource[] resourceAnnotations, KnowledgeNamespace knowledgeNamespace) {
if (resourceAnnotations == null || resourceAnnotations.length == 0) {
return null;
}
ResourcesModel resourcesModel = new V1ResourcesModel(knowledgeNamespace.uri());
... | java | protected ResourcesModel toResourcesModel(Resource[] resourceAnnotations, KnowledgeNamespace knowledgeNamespace) {
if (resourceAnnotations == null || resourceAnnotations.length == 0) {
return null;
}
ResourcesModel resourcesModel = new V1ResourcesModel(knowledgeNamespace.uri());
... | [
"protected",
"ResourcesModel",
"toResourcesModel",
"(",
"Resource",
"[",
"]",
"resourceAnnotations",
",",
"KnowledgeNamespace",
"knowledgeNamespace",
")",
"{",
"if",
"(",
"resourceAnnotations",
"==",
"null",
"||",
"resourceAnnotations",
".",
"length",
"==",
"0",
")",
... | Converts resource annotations to resources model.
@param resourceAnnotations resourceAnnotations
@param knowledgeNamespace knowledgeNamespace
@return model | [
"Converts",
"resource",
"annotations",
"to",
"resources",
"model",
"."
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/model/KnowledgeSwitchYardScanner.java#L370-L392 | train |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperation.java | KnowledgeOperation.getInputOnlyExpressionMappings | public List<ExpressionMapping> getInputOnlyExpressionMappings() {
List<ExpressionMapping> list = new LinkedList<ExpressionMapping>();
for (ExpressionMapping em : _inputExpressionMappings) {
if (em.getOutput() == null) {
list.add(em);
}
}
return lis... | java | public List<ExpressionMapping> getInputOnlyExpressionMappings() {
List<ExpressionMapping> list = new LinkedList<ExpressionMapping>();
for (ExpressionMapping em : _inputExpressionMappings) {
if (em.getOutput() == null) {
list.add(em);
}
}
return lis... | [
"public",
"List",
"<",
"ExpressionMapping",
">",
"getInputOnlyExpressionMappings",
"(",
")",
"{",
"List",
"<",
"ExpressionMapping",
">",
"list",
"=",
"new",
"LinkedList",
"<",
"ExpressionMapping",
">",
"(",
")",
";",
"for",
"(",
"ExpressionMapping",
"em",
":",
... | Gets the input-only expression mappings.
@return the input-only expression mappings | [
"Gets",
"the",
"input",
"-",
"only",
"expression",
"mappings",
"."
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperation.java#L83-L91 | train |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperation.java | KnowledgeOperation.getInputOutputExpressionMappings | public Map<String, ExpressionMapping> getInputOutputExpressionMappings() {
Map<String, ExpressionMapping> map = new LinkedHashMap<String, ExpressionMapping>();
for (ExpressionMapping em : _inputExpressionMappings) {
String output = em.getOutput();
if (output != null) {
... | java | public Map<String, ExpressionMapping> getInputOutputExpressionMappings() {
Map<String, ExpressionMapping> map = new LinkedHashMap<String, ExpressionMapping>();
for (ExpressionMapping em : _inputExpressionMappings) {
String output = em.getOutput();
if (output != null) {
... | [
"public",
"Map",
"<",
"String",
",",
"ExpressionMapping",
">",
"getInputOutputExpressionMappings",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"ExpressionMapping",
">",
"map",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"ExpressionMapping",
">",
"(",
")",
"... | Gets the input-output expression mappings.
@return the input-output expression mappings | [
"Gets",
"the",
"input",
"-",
"output",
"expression",
"mappings",
"."
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/operation/KnowledgeOperation.java#L96-L109 | train |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/manifest/Manifest.java | Manifest.removeFromEnvironment | protected static <T extends Manifest> T removeFromEnvironment(Environment environment, Class<T> type) {
String identifier = type.getName();
Object manifest = environment.get(identifier);
if (manifest != null) {
environment.set(identifier, null);
}
return type.cast(man... | java | protected static <T extends Manifest> T removeFromEnvironment(Environment environment, Class<T> type) {
String identifier = type.getName();
Object manifest = environment.get(identifier);
if (manifest != null) {
environment.set(identifier, null);
}
return type.cast(man... | [
"protected",
"static",
"<",
"T",
"extends",
"Manifest",
">",
"T",
"removeFromEnvironment",
"(",
"Environment",
"environment",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"String",
"identifier",
"=",
"type",
".",
"getName",
"(",
")",
";",
"Object",
"mani... | Removes and returns the Manifest from the Environment.
@param environment the Environment
@param type the type of Manifest
@return the Manifest | [
"Removes",
"and",
"returns",
"the",
"Manifest",
"from",
"the",
"Environment",
"."
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/manifest/Manifest.java#L44-L51 | train |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/expression/ExpressionMapping.java | ExpressionMapping.getFromExpression | public Expression getFromExpression() {
if (_fromExpression == null && _from != null) {
_fromExpression = ExpressionFactory.INSTANCE.create(_from, null, _propertyResolver);
}
return _fromExpression;
} | java | public Expression getFromExpression() {
if (_fromExpression == null && _from != null) {
_fromExpression = ExpressionFactory.INSTANCE.create(_from, null, _propertyResolver);
}
return _fromExpression;
} | [
"public",
"Expression",
"getFromExpression",
"(",
")",
"{",
"if",
"(",
"_fromExpression",
"==",
"null",
"&&",
"_from",
"!=",
"null",
")",
"{",
"_fromExpression",
"=",
"ExpressionFactory",
".",
"INSTANCE",
".",
"create",
"(",
"_from",
",",
"null",
",",
"_prop... | Gets the from expression.
@return the from expression | [
"Gets",
"the",
"from",
"expression",
"."
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/expression/ExpressionMapping.java#L66-L71 | train |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/expression/ExpressionMapping.java | ExpressionMapping.getToExpression | public Expression getToExpression() {
if (_toExpression == null && _to != null) {
_toExpression = ExpressionFactory.INSTANCE.create(_to, null, _propertyResolver);
}
return _toExpression;
} | java | public Expression getToExpression() {
if (_toExpression == null && _to != null) {
_toExpression = ExpressionFactory.INSTANCE.create(_to, null, _propertyResolver);
}
return _toExpression;
} | [
"public",
"Expression",
"getToExpression",
"(",
")",
"{",
"if",
"(",
"_toExpression",
"==",
"null",
"&&",
"_to",
"!=",
"null",
")",
"{",
"_toExpression",
"=",
"ExpressionFactory",
".",
"INSTANCE",
".",
"create",
"(",
"_to",
",",
"null",
",",
"_propertyResolv... | Gets the to expression.
@return the to expression | [
"Gets",
"the",
"to",
"expression",
"."
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/expression/ExpressionMapping.java#L83-L88 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java | Session.addConnections | public final void addConnections (final int max) throws Exception {
if (connections.size() < maxConnections) {
for (int i = 1; i < max; i++) {
addNewConnection();
}
}
} | java | public final void addConnections (final int max) throws Exception {
if (connections.size() < maxConnections) {
for (int i = 1; i < max; i++) {
addNewConnection();
}
}
} | [
"public",
"final",
"void",
"addConnections",
"(",
"final",
"int",
"max",
")",
"throws",
"Exception",
"{",
"if",
"(",
"connections",
".",
"size",
"(",
")",
"<",
"maxConnections",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"max",
";",
... | Adds a number of new connections to this session.
@param max The number of Connections to open.
@throws Exception if any error occurs. | [
"Adds",
"a",
"number",
"of",
"new",
"connections",
"to",
"this",
"session",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java#L292-L299 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java | Session.close | public final void close () throws IOException {
LOGGER.info("Closing was requested.");
for (Connection c : connections) {
c.close();
}
connections.clear();
// stop session task thread
factory.closedSession(this);
executor.shutdown();
} | java | public final void close () throws IOException {
LOGGER.info("Closing was requested.");
for (Connection c : connections) {
c.close();
}
connections.clear();
// stop session task thread
factory.closedSession(this);
executor.shutdown();
} | [
"public",
"final",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"LOGGER",
".",
"info",
"(",
"\"Closing was requested.\"",
")",
";",
"for",
"(",
"Connection",
"c",
":",
"connections",
")",
"{",
"c",
".",
"close",
"(",
")",
";",
"}",
"connectio... | Closes this session instances with all opened connections.
@throws IOException if an I/O error occurs. | [
"Closes",
"this",
"session",
"instances",
"with",
"all",
"opened",
"connections",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java#L402-L415 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java | Session.executeTask | private final Future<Void> executeTask (final ITask task) throws TaskExecutionException {
if (task instanceof IOTask) {
final Future<Void> returnVal = executor.submit((IOTask) task);
return returnVal;
} else {
try {
task.call();
} catch (f... | java | private final Future<Void> executeTask (final ITask task) throws TaskExecutionException {
if (task instanceof IOTask) {
final Future<Void> returnVal = executor.submit((IOTask) task);
return returnVal;
} else {
try {
task.call();
} catch (f... | [
"private",
"final",
"Future",
"<",
"Void",
">",
"executeTask",
"(",
"final",
"ITask",
"task",
")",
"throws",
"TaskExecutionException",
"{",
"if",
"(",
"task",
"instanceof",
"IOTask",
")",
"{",
"final",
"Future",
"<",
"Void",
">",
"returnVal",
"=",
"executor"... | This methods appends the given task to the end of the taskQueue and set the calling thread is sleep state.
@param task The task to append to the end of the taskQueue.
@throws InterruptedException if another thread interrupted the current thread before or while the current thread
was waiting for a notification. The int... | [
"This",
"methods",
"appends",
"the",
"given",
"task",
"to",
"the",
"end",
"of",
"the",
"taskQueue",
"and",
"set",
"the",
"calling",
"thread",
"is",
"sleep",
"state",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java#L534-L548 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java | Session.finishedTask | public final void finishedTask (final ITask ftask) {
try {
taskBalancer.releaseConnection(outstandingTasks.get(ftask));
} catch (NoSuchConnectionException e) {
e.printStackTrace();
}
outstandingTasks.remove(ftask);
LOGGER.debug("Finished a " + ftask + " f... | java | public final void finishedTask (final ITask ftask) {
try {
taskBalancer.releaseConnection(outstandingTasks.get(ftask));
} catch (NoSuchConnectionException e) {
e.printStackTrace();
}
outstandingTasks.remove(ftask);
LOGGER.debug("Finished a " + ftask + " f... | [
"public",
"final",
"void",
"finishedTask",
"(",
"final",
"ITask",
"ftask",
")",
"{",
"try",
"{",
"taskBalancer",
".",
"releaseConnection",
"(",
"outstandingTasks",
".",
"get",
"(",
"ftask",
")",
")",
";",
"}",
"catch",
"(",
"NoSuchConnectionException",
"e",
... | removes Task from outstandingTasks.
@param ftask The Task which was finished . | [
"removes",
"Task",
"from",
"outstandingTasks",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java#L555-L564 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java | Session.restartTask | public final void restartTask (final ITask task) throws ExecutionException {
try {
if (task != null) {
if (task instanceof IOTask) {
executor.submit((IOTask) task);
} else {
task.call();
}
taskBa... | java | public final void restartTask (final ITask task) throws ExecutionException {
try {
if (task != null) {
if (task instanceof IOTask) {
executor.submit((IOTask) task);
} else {
task.call();
}
taskBa... | [
"public",
"final",
"void",
"restartTask",
"(",
"final",
"ITask",
"task",
")",
"throws",
"ExecutionException",
"{",
"try",
"{",
"if",
"(",
"task",
"!=",
"null",
")",
"{",
"if",
"(",
"task",
"instanceof",
"IOTask",
")",
"{",
"executor",
".",
"submit",
"(",... | restarts a Task from outstandingTasks.
@param task The failed Task.
@throws ExecutionException for failed restart of the task | [
"restarts",
"a",
"Task",
"from",
"outstandingTasks",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java#L572-L588 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java | Session.addOutstandingTask | public final void addOutstandingTask (final Connection connection, final ITask task) {
outstandingTasks.put(task, connection);
LOGGER.debug("Added a Task to the outstandingTasks Queue");
} | java | public final void addOutstandingTask (final Connection connection, final ITask task) {
outstandingTasks.put(task, connection);
LOGGER.debug("Added a Task to the outstandingTasks Queue");
} | [
"public",
"final",
"void",
"addOutstandingTask",
"(",
"final",
"Connection",
"connection",
",",
"final",
"ITask",
"task",
")",
"{",
"outstandingTasks",
".",
"put",
"(",
"task",
",",
"connection",
")",
";",
"LOGGER",
".",
"debug",
"(",
"\"Added a Task to the outs... | Adds a Task to the outstandingTasks Hashmap.
@param connection The Connection where the Task will be started
@param task The Task which was started. | [
"Adds",
"a",
"Task",
"to",
"the",
"outstandingTasks",
"Hashmap",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/connection/Session.java#L596-L600 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/connection/phase/TargetFullFeaturePhase.java | TargetFullFeaturePhase.execute | public boolean execute () throws DigestException , IOException , InterruptedException , InternetSCSIException , SettingsException {
running = true;
while (running) {
ProtocolDataUnit pdu = connection.receivePdu();
BasicHeaderSegment bhs = pdu.getBasicHeaderSegment();
... | java | public boolean execute () throws DigestException , IOException , InterruptedException , InternetSCSIException , SettingsException {
running = true;
while (running) {
ProtocolDataUnit pdu = connection.receivePdu();
BasicHeaderSegment bhs = pdu.getBasicHeaderSegment();
... | [
"public",
"boolean",
"execute",
"(",
")",
"throws",
"DigestException",
",",
"IOException",
",",
"InterruptedException",
",",
"InternetSCSIException",
",",
"SettingsException",
"{",
"running",
"=",
"true",
";",
"while",
"(",
"running",
")",
"{",
"ProtocolDataUnit",
... | Starts the full feature phase.
@return {@inheritDoc}
@throws OperationNotSupportedException {@inheritDoc}
@throws IOException {@inheritDoc}
@throws InterruptedException {@inheritDoc}
@throws InternetSCSIException {@inheritDoc}
@throws DigestException {@inheritDoc}
@throws SettingsException {@inheritDoc} | [
"Starts",
"the",
"full",
"feature",
"phase",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/connection/phase/TargetFullFeaturePhase.java#L78-L177 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/Initiator.java | Initiator.closeSession | public final void closeSession (final String targetName) throws NoSuchSessionException , TaskExecutionException {
getSession(targetName).logout();
// TODO Test the removal from the map.
sessions.remove(targetName);
LOGGER.info("Closed the session to the iSCSI Target '" + targetName + "... | java | public final void closeSession (final String targetName) throws NoSuchSessionException , TaskExecutionException {
getSession(targetName).logout();
// TODO Test the removal from the map.
sessions.remove(targetName);
LOGGER.info("Closed the session to the iSCSI Target '" + targetName + "... | [
"public",
"final",
"void",
"closeSession",
"(",
"final",
"String",
"targetName",
")",
"throws",
"NoSuchSessionException",
",",
"TaskExecutionException",
"{",
"getSession",
"(",
"targetName",
")",
".",
"logout",
"(",
")",
";",
"// TODO Test the removal from the map.",
... | Closes all opened connections within this session to the given target.
@param targetName The name of the target, which connection should be closed.
@throws NoSuchSessionException if no session is accessible
@throws TaskExecutionException if logout fails. | [
"Closes",
"all",
"opened",
"connections",
"within",
"this",
"session",
"to",
"the",
"given",
"target",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/Initiator.java#L113-L120 | train |
sebastiangraf/jSCSI | bundles/initiatorExtensions/storagePool/src/main/java/org/jscsi/initiator/devices/WriteBufferDevice.java | WriteBufferDevice.flush | public final synchronized void flush() throws Exception {
List<Long> sortedKeys = new ArrayList<Long>(buffer.keySet());
Collections.sort(sortedKeys);
while (sortedKeys.size() > 0) {
long firstKey = sortedKeys.get(0);
int firstDataLength = buffer.get(firstKey).length;
... | java | public final synchronized void flush() throws Exception {
List<Long> sortedKeys = new ArrayList<Long>(buffer.keySet());
Collections.sort(sortedKeys);
while (sortedKeys.size() > 0) {
long firstKey = sortedKeys.get(0);
int firstDataLength = buffer.get(firstKey).length;
... | [
"public",
"final",
"synchronized",
"void",
"flush",
"(",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Long",
">",
"sortedKeys",
"=",
"new",
"ArrayList",
"<",
"Long",
">",
"(",
"buffer",
".",
"keySet",
"(",
")",
")",
";",
"Collections",
".",
"sort",
"... | Flush the buffer to the target.
@throws Exception
for any error | [
"Flush",
"the",
"buffer",
"to",
"the",
"target",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiatorExtensions/storagePool/src/main/java/org/jscsi/initiator/devices/WriteBufferDevice.java#L124-L151 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/storage/FileStorageModule.java | FileStorageModule.read | public void read (byte[] bytes, long storageIndex) throws IOException {
long filePos = storageIndex / mFileSize;
int storageOffset = (int) (storageIndex % mFileSize);
byte[] cachedBytes = mCache.getIfPresent(filePos);
File fileAtPos = new File(mBaseDir + File.separator + filePos);
... | java | public void read (byte[] bytes, long storageIndex) throws IOException {
long filePos = storageIndex / mFileSize;
int storageOffset = (int) (storageIndex % mFileSize);
byte[] cachedBytes = mCache.getIfPresent(filePos);
File fileAtPos = new File(mBaseDir + File.separator + filePos);
... | [
"public",
"void",
"read",
"(",
"byte",
"[",
"]",
"bytes",
",",
"long",
"storageIndex",
")",
"throws",
"IOException",
"{",
"long",
"filePos",
"=",
"storageIndex",
"/",
"mFileSize",
";",
"int",
"storageOffset",
"=",
"(",
"int",
")",
"(",
"storageIndex",
"%",... | Reading bytes from file
@param bytes
@param storageIndex
@throws IOException | [
"Reading",
"bytes",
"from",
"file"
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/storage/FileStorageModule.java#L68-L93 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/BasicHeaderSegment.java | BasicHeaderSegment.serialize | final int serialize (final ByteBuffer dst, final int offset) throws InternetSCSIException {
// has the destination array enough space to store this basic header
// segment
dst.position(offset);
if (dst.remaining() < BHS_FIXED_SIZE) { throw new IllegalArgumentException("Destination array... | java | final int serialize (final ByteBuffer dst, final int offset) throws InternetSCSIException {
// has the destination array enough space to store this basic header
// segment
dst.position(offset);
if (dst.remaining() < BHS_FIXED_SIZE) { throw new IllegalArgumentException("Destination array... | [
"final",
"int",
"serialize",
"(",
"final",
"ByteBuffer",
"dst",
",",
"final",
"int",
"offset",
")",
"throws",
"InternetSCSIException",
"{",
"// has the destination array enough space to store this basic header",
"// segment",
"dst",
".",
"position",
"(",
"offset",
")",
... | This method serializes the informations of this BHS object to the byte representation defined by the iSCSI
Standard.
@param dst The destination array to write in.
@param offset The start offset in <code>dst</code>.
@return The length (in bytes) of the serialized form of this BHS object.
@throws InternetSCSIException I... | [
"This",
"method",
"serializes",
"the",
"informations",
"of",
"this",
"BHS",
"object",
"to",
"the",
"byte",
"representation",
"defined",
"by",
"the",
"iSCSI",
"Standard",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/BasicHeaderSegment.java#L137-L162 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/BasicHeaderSegment.java | BasicHeaderSegment.deserialize | final int deserialize (final ProtocolDataUnit protocolDataUnit, final ByteBuffer src) throws InternetSCSIException {
if (src.remaining() < BHS_FIXED_SIZE) { throw new InternetSCSIException("This Protocol Data Unit does not contain" + " an valid Basic Header Segment."); }
final int firstLine = src.getI... | java | final int deserialize (final ProtocolDataUnit protocolDataUnit, final ByteBuffer src) throws InternetSCSIException {
if (src.remaining() < BHS_FIXED_SIZE) { throw new InternetSCSIException("This Protocol Data Unit does not contain" + " an valid Basic Header Segment."); }
final int firstLine = src.getI... | [
"final",
"int",
"deserialize",
"(",
"final",
"ProtocolDataUnit",
"protocolDataUnit",
",",
"final",
"ByteBuffer",
"src",
")",
"throws",
"InternetSCSIException",
"{",
"if",
"(",
"src",
".",
"remaining",
"(",
")",
"<",
"BHS_FIXED_SIZE",
")",
"{",
"throw",
"new",
... | Extract from the given Protocol Data Unit the BHS. After an successful extraction this methods and setreturns the
right message parser object for this kind of message.
@param protocolDataUnit The reference <code>ProtocolDataUnit</code> instance, which contains this
<code>BasicHeaderSegment</code> object.
@param src Th... | [
"Extract",
"from",
"the",
"given",
"Protocol",
"Data",
"Unit",
"the",
"BHS",
".",
"After",
"an",
"successful",
"extraction",
"this",
"methods",
"and",
"setreturns",
"the",
"right",
"message",
"parser",
"object",
"for",
"this",
"kind",
"of",
"message",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/BasicHeaderSegment.java#L174-L199 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/BasicHeaderSegment.java | BasicHeaderSegment.setOperationCode | final void setOperationCode (final ProtocolDataUnit protocolDataUnit, final OperationCode initOperationCode) {
operationCode = initOperationCode;
parser = MessageParserFactory.getParser(protocolDataUnit, initOperationCode);
} | java | final void setOperationCode (final ProtocolDataUnit protocolDataUnit, final OperationCode initOperationCode) {
operationCode = initOperationCode;
parser = MessageParserFactory.getParser(protocolDataUnit, initOperationCode);
} | [
"final",
"void",
"setOperationCode",
"(",
"final",
"ProtocolDataUnit",
"protocolDataUnit",
",",
"final",
"OperationCode",
"initOperationCode",
")",
"{",
"operationCode",
"=",
"initOperationCode",
";",
"parser",
"=",
"MessageParserFactory",
".",
"getParser",
"(",
"protoc... | Set a new operation code for this BHS object.
@param protocolDataUnit The reference <code>ProtocolDataUnit</code> instance, which contains this
<code>BasicHeaderSegment</code> object.
@param initOperationCode The new operation code. | [
"Set",
"a",
"new",
"operation",
"code",
"for",
"this",
"BHS",
"object",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/BasicHeaderSegment.java#L340-L344 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/BasicHeaderSegment.java | BasicHeaderSegment.clear | final void clear () {
immediateFlag = false;
operationCode = OperationCode.LOGIN_REQUEST;
finalFlag = false;
totalAHSLength = 0x00;
dataSegmentLength = 0x00000000;
initiatorTaskTag = 0x00000000;
parser = null;
} | java | final void clear () {
immediateFlag = false;
operationCode = OperationCode.LOGIN_REQUEST;
finalFlag = false;
totalAHSLength = 0x00;
dataSegmentLength = 0x00000000;
initiatorTaskTag = 0x00000000;
parser = null;
} | [
"final",
"void",
"clear",
"(",
")",
"{",
"immediateFlag",
"=",
"false",
";",
"operationCode",
"=",
"OperationCode",
".",
"LOGIN_REQUEST",
";",
"finalFlag",
"=",
"false",
";",
"totalAHSLength",
"=",
"0x00",
";",
"dataSegmentLength",
"=",
"0x00000000",
";",
"ini... | Clears all the stored content of this BasicHeaderSegment object. | [
"Clears",
"all",
"the",
"stored",
"content",
"of",
"this",
"BasicHeaderSegment",
"object",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/BasicHeaderSegment.java#L412-L423 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/AdditionalHeaderSegment.java | AdditionalHeaderSegment.serialize | final int serialize (final ByteBuffer dst, final int offset) throws InternetSCSIException {
dst.position(offset);
if (dst.remaining() < length) { throw new IllegalArgumentException("Destination array is too small."); }
dst.putShort(length);
dst.put(type.value());
dst.put(specif... | java | final int serialize (final ByteBuffer dst, final int offset) throws InternetSCSIException {
dst.position(offset);
if (dst.remaining() < length) { throw new IllegalArgumentException("Destination array is too small."); }
dst.putShort(length);
dst.put(type.value());
dst.put(specif... | [
"final",
"int",
"serialize",
"(",
"final",
"ByteBuffer",
"dst",
",",
"final",
"int",
"offset",
")",
"throws",
"InternetSCSIException",
"{",
"dst",
".",
"position",
"(",
"offset",
")",
";",
"if",
"(",
"dst",
".",
"remaining",
"(",
")",
"<",
"length",
")",... | This method serializes the informations of this AHS object to the byte representation defined by the iSCSI
Standard.
@param dst The destination array to write in.
@param offset The start offset in <code>dst</code>.
@return The length of used integers of the serialized form of this AHS object.
@throws InternetSCSIExcep... | [
"This",
"method",
"serializes",
"the",
"informations",
"of",
"this",
"AHS",
"object",
"to",
"the",
"byte",
"representation",
"defined",
"by",
"the",
"iSCSI",
"Standard",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/AdditionalHeaderSegment.java#L215-L229 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/AdditionalHeaderSegment.java | AdditionalHeaderSegment.deserialize | final void deserialize (final ByteBuffer pdu, final int offset) throws InternetSCSIException {
pdu.position(offset);
length = pdu.getShort();
type = AdditionalHeaderSegmentType.valueOf(pdu.get());
// allocate the needed memory
specificField = ByteBuffer.allocate(length);
... | java | final void deserialize (final ByteBuffer pdu, final int offset) throws InternetSCSIException {
pdu.position(offset);
length = pdu.getShort();
type = AdditionalHeaderSegmentType.valueOf(pdu.get());
// allocate the needed memory
specificField = ByteBuffer.allocate(length);
... | [
"final",
"void",
"deserialize",
"(",
"final",
"ByteBuffer",
"pdu",
",",
"final",
"int",
"offset",
")",
"throws",
"InternetSCSIException",
"{",
"pdu",
".",
"position",
"(",
"offset",
")",
";",
"length",
"=",
"pdu",
".",
"getShort",
"(",
")",
";",
"type",
... | Extract the informations given by the int array to this Additional Header Segment object.
@param pdu The Protocol Data Unit to be parsed.
@param offset The offset, where to start in the pdu.
@throws InternetSCSIException If any violation of the iSCSI-Standard emerge. | [
"Extract",
"the",
"informations",
"given",
"by",
"the",
"int",
"array",
"to",
"this",
"Additional",
"Header",
"Segment",
"object",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/AdditionalHeaderSegment.java#L238-L254 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/AdditionalHeaderSegment.java | AdditionalHeaderSegment.checkIntegrity | private final void checkIntegrity () throws InternetSCSIException {
switch (type) {
case EXTENDED_CDB :
case EXPECTED_BIDIRECTIONAL_READ_DATA_LENGTH :
break;
default :
throw new InternetSCSIException("AHS Package is not valid.");
}
... | java | private final void checkIntegrity () throws InternetSCSIException {
switch (type) {
case EXTENDED_CDB :
case EXPECTED_BIDIRECTIONAL_READ_DATA_LENGTH :
break;
default :
throw new InternetSCSIException("AHS Package is not valid.");
}
... | [
"private",
"final",
"void",
"checkIntegrity",
"(",
")",
"throws",
"InternetSCSIException",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"EXTENDED_CDB",
":",
"case",
"EXPECTED_BIDIRECTIONAL_READ_DATA_LENGTH",
":",
"break",
";",
"default",
":",
"throw",
"new",
"Int... | This method checks the integrity of the this Additional Header Segment object to garantee a valid specification.
@throws InternetSCSIException If the fields are not valid for this AHS type. | [
"This",
"method",
"checks",
"the",
"integrity",
"of",
"the",
"this",
"Additional",
"Header",
"Segment",
"object",
"to",
"garantee",
"a",
"valid",
"specification",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/AdditionalHeaderSegment.java#L374-L403 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/scsi/sense/senseDataDescriptor/senseKeySpecific/SenseKeySpecificData.java | SenseKeySpecificData.serializeCommonFields | private final void serializeCommonFields (final ByteBuffer byteBuffer, final int index) {
byteBuffer.position(index);
byte b = 0;
if (senseKeySpecificDataValid) b = BitManip.getByteWithBitSet(b, 7, true);// set MSB to 1
byteBuffer.put(b);
} | java | private final void serializeCommonFields (final ByteBuffer byteBuffer, final int index) {
byteBuffer.position(index);
byte b = 0;
if (senseKeySpecificDataValid) b = BitManip.getByteWithBitSet(b, 7, true);// set MSB to 1
byteBuffer.put(b);
} | [
"private",
"final",
"void",
"serializeCommonFields",
"(",
"final",
"ByteBuffer",
"byteBuffer",
",",
"final",
"int",
"index",
")",
"{",
"byteBuffer",
".",
"position",
"(",
"index",
")",
";",
"byte",
"b",
"=",
"0",
";",
"if",
"(",
"senseKeySpecificDataValid",
... | Serializes the fields common to all sense-key-specific data.
@param byteBuffer where the serialized fields will be stored
@param index the position of the first byte of the sense data descriptor in the {@link ByteBuffer} | [
"Serializes",
"the",
"fields",
"common",
"to",
"all",
"sense",
"-",
"key",
"-",
"specific",
"data",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/scsi/sense/senseDataDescriptor/senseKeySpecific/SenseKeySpecificData.java#L81-L86 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/scsi/sense/senseDataDescriptor/SenseDataDescriptor.java | SenseDataDescriptor.serializeCommonFields | private final void serializeCommonFields (final ByteBuffer byteBuffer, final int index) {
byteBuffer.position(index);
byteBuffer.put(descriptorType.getValue());
byteBuffer.put((byte) additionalLength);
} | java | private final void serializeCommonFields (final ByteBuffer byteBuffer, final int index) {
byteBuffer.position(index);
byteBuffer.put(descriptorType.getValue());
byteBuffer.put((byte) additionalLength);
} | [
"private",
"final",
"void",
"serializeCommonFields",
"(",
"final",
"ByteBuffer",
"byteBuffer",
",",
"final",
"int",
"index",
")",
"{",
"byteBuffer",
".",
"position",
"(",
"index",
")",
";",
"byteBuffer",
".",
"put",
"(",
"descriptorType",
".",
"getValue",
"(",... | Serializes the fields common to all sense data descriptors.
@param byteBuffer where the serialized fields will be stored
@param index the position of the first byte of the sense data descriptor in the {@link ByteBuffer} | [
"Serializes",
"the",
"fields",
"common",
"to",
"all",
"sense",
"data",
"descriptors",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/scsi/sense/senseDataDescriptor/SenseDataDescriptor.java#L54-L58 | train |
sebastiangraf/jSCSI | bundles/targetExtensions/scsi/src/org/jscsi/scsi/protocol/cdb/CDBFactory.java | CDBFactory.decode | @SuppressWarnings("unchecked")
public CDB decode(ByteBuffer input) throws IOException
{
byte[] opcode = new byte[1];
input.duplicate().get(opcode); // Read in the operation code without changing the position
DataInputStream in = new DataInputStream(new ByteArrayInputStream(opcode));
... | java | @SuppressWarnings("unchecked")
public CDB decode(ByteBuffer input) throws IOException
{
byte[] opcode = new byte[1];
input.duplicate().get(opcode); // Read in the operation code without changing the position
DataInputStream in = new DataInputStream(new ByteArrayInputStream(opcode));
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"CDB",
"decode",
"(",
"ByteBuffer",
"input",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"opcode",
"=",
"new",
"byte",
"[",
"1",
"]",
";",
"input",
".",
"duplicate",
"(",
")",
".",
... | Used by iSCSI transport layer to decode CDB data off the wire.
@param input
@return
@throws BufferUnderflowException
@throws IOException | [
"Used",
"by",
"iSCSI",
"transport",
"layer",
"to",
"decode",
"CDB",
"data",
"off",
"the",
"wire",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/targetExtensions/scsi/src/org/jscsi/scsi/protocol/cdb/CDBFactory.java#L117-L146 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/scsi/SCSICommandDescriptorBlockParser.java | SCSICommandDescriptorBlockParser.createReadWriteMessage | private static final ByteBuffer createReadWriteMessage (final byte opCode, final int logicalBlockAddress, final short transferLength) {
ByteBuffer cdb = ByteBuffer.allocate(DEFAULT_CDB_LENGTH);
// operation code
cdb.put(opCode);
// logical block address
cdb.position(LOGICAL_BLO... | java | private static final ByteBuffer createReadWriteMessage (final byte opCode, final int logicalBlockAddress, final short transferLength) {
ByteBuffer cdb = ByteBuffer.allocate(DEFAULT_CDB_LENGTH);
// operation code
cdb.put(opCode);
// logical block address
cdb.position(LOGICAL_BLO... | [
"private",
"static",
"final",
"ByteBuffer",
"createReadWriteMessage",
"(",
"final",
"byte",
"opCode",
",",
"final",
"int",
"logicalBlockAddress",
",",
"final",
"short",
"transferLength",
")",
"{",
"ByteBuffer",
"cdb",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"DEFA... | Creates the Command Descriptor Block for a given Operation Message.
@param opCode The Operation Code.
@param logicalBlockAddress The Logical Block Address to begin the read operation.
@param transferLength The transfer length field specifies the number of contiguous logical blocks of data to be
transferred. A transfer... | [
"Creates",
"the",
"Command",
"Descriptor",
"Block",
"for",
"a",
"given",
"Operation",
"Message",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/scsi/SCSICommandDescriptorBlockParser.java#L346-L363 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/scsi/SCSICommandDescriptorBlockParser.java | SCSICommandDescriptorBlockParser.createReadCapacityMessage | public static final ByteBuffer createReadCapacityMessage () {
ByteBuffer cdb = ByteBuffer.allocate(DEFAULT_CDB_LENGTH);
// operation code
cdb.put(READ_CAPACITY_OP_CODE);
cdb.rewind();
return cdb;
} | java | public static final ByteBuffer createReadCapacityMessage () {
ByteBuffer cdb = ByteBuffer.allocate(DEFAULT_CDB_LENGTH);
// operation code
cdb.put(READ_CAPACITY_OP_CODE);
cdb.rewind();
return cdb;
} | [
"public",
"static",
"final",
"ByteBuffer",
"createReadCapacityMessage",
"(",
")",
"{",
"ByteBuffer",
"cdb",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"DEFAULT_CDB_LENGTH",
")",
";",
"// operation code",
"cdb",
".",
"put",
"(",
"READ_CAPACITY_OP_CODE",
")",
";",
"cd... | Creates the Command Descriptor Block for a Read Capacity Message.
@return A <code>ByteBuffer</code> object with the above data. | [
"Creates",
"the",
"Command",
"Descriptor",
"Block",
"for",
"a",
"Read",
"Capacity",
"Message",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/scsi/SCSICommandDescriptorBlockParser.java#L370-L379 | train |
sebastiangraf/jSCSI | bundles/initiatorExtensions/whiskas/whiskas/WhiskasDemo/src/org/jscsi/whiskas/WhiskasDemo.java | WhiskasDemo.main | public static void main(final String[] args) throws Exception {
WhiskasDemo demo = new WhiskasDemo();
demo.setUp();
while (true) {
demo.sequentialRead();
demo.randomRead();
}
} | java | public static void main(final String[] args) throws Exception {
WhiskasDemo demo = new WhiskasDemo();
demo.setUp();
while (true) {
demo.sequentialRead();
demo.randomRead();
}
} | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"WhiskasDemo",
"demo",
"=",
"new",
"WhiskasDemo",
"(",
")",
";",
"demo",
".",
"setUp",
"(",
")",
";",
"while",
"(",
"true",
")",
"{",
"demo... | Main method to start the demo.
@param args
arguments ...
@throws Exception
if any error occurs | [
"Main",
"method",
"to",
"start",
"the",
"demo",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiatorExtensions/whiskas/whiskas/WhiskasDemo/src/org/jscsi/whiskas/WhiskasDemo.java#L125-L135 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/TargetServer.java | TargetServer.stop | public void stop(){
this.running = false;
for(TargetSession session : sessions){
if(!session.getConnection().stop()){
this.running = true;
LOGGER.error("Unable to stop session for " + session.getTargetName());
}
}
} | java | public void stop(){
this.running = false;
for(TargetSession session : sessions){
if(!session.getConnection().stop()){
this.running = true;
LOGGER.error("Unable to stop session for " + session.getTargetName());
}
}
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"this",
".",
"running",
"=",
"false",
";",
"for",
"(",
"TargetSession",
"session",
":",
"sessions",
")",
"{",
"if",
"(",
"!",
"session",
".",
"getConnection",
"(",
")",
".",
"stop",
"(",
")",
")",
"{",
"this... | Stop this target server | [
"Stop",
"this",
"target",
"server"
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/TargetServer.java#L348-L356 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/login/ISID.java | ISID.serialize | public final long serialize () throws InternetSCSIException {
checkIntegrity();
long isid = 0;
int firstLine = c;
firstLine |= b << Constants.ONE_BYTE_SHIFT;
firstLine |= a << Constants.THREE_BYTES_SHIFT;
firstLine &= 0x00ffffff;
firstLine |= t.value() << T_FIE... | java | public final long serialize () throws InternetSCSIException {
checkIntegrity();
long isid = 0;
int firstLine = c;
firstLine |= b << Constants.ONE_BYTE_SHIFT;
firstLine |= a << Constants.THREE_BYTES_SHIFT;
firstLine &= 0x00ffffff;
firstLine |= t.value() << T_FIE... | [
"public",
"final",
"long",
"serialize",
"(",
")",
"throws",
"InternetSCSIException",
"{",
"checkIntegrity",
"(",
")",
";",
"long",
"isid",
"=",
"0",
";",
"int",
"firstLine",
"=",
"c",
";",
"firstLine",
"|=",
"b",
"<<",
"Constants",
".",
"ONE_BYTE_SHIFT",
"... | Serializes this ISID object ot its byte representation.
@return The byte representation of this ISID object.
@throws InternetSCSIException If any violation of the iSCSI-Standard emerge. | [
"Serializes",
"this",
"ISID",
"object",
"ot",
"its",
"byte",
"representation",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/login/ISID.java#L292-L308 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/login/ISID.java | ISID.deserialize | final void deserialize ( long isid) throws InternetSCSIException {
int line = (int) (isid >>> Constants.FOUR_BYTES_SHIFT);
t = Format.valueOf((byte) (line >>> T_FIELD_SHIFT));
a = (byte) ((line & A_FIELD_FLAG_MASK) >>> Constants.THREE_BYTES_SHIFT);
b = (short) ((line & Constant... | java | final void deserialize ( long isid) throws InternetSCSIException {
int line = (int) (isid >>> Constants.FOUR_BYTES_SHIFT);
t = Format.valueOf((byte) (line >>> T_FIELD_SHIFT));
a = (byte) ((line & A_FIELD_FLAG_MASK) >>> Constants.THREE_BYTES_SHIFT);
b = (short) ((line & Constant... | [
"final",
"void",
"deserialize",
"(",
"long",
"isid",
")",
"throws",
"InternetSCSIException",
"{",
"int",
"line",
"=",
"(",
"int",
")",
"(",
"isid",
">>>",
"Constants",
".",
"FOUR_BYTES_SHIFT",
")",
";",
"t",
"=",
"Format",
".",
"valueOf",
"(",
"(",
"byte... | Parses a given ISID in this ISID obejct.
@param isid The byte representation of a ISID to parse.
@throws InternetSCSIException If any violation of the iSCSI-Standard emerge. | [
"Parses",
"a",
"given",
"ISID",
"in",
"this",
"ISID",
"obejct",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/login/ISID.java#L316-L328 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/login/ISID.java | ISID.checkIntegrity | protected final void checkIntegrity () throws InternetSCSIException {
String exceptionMessage = "";
switch (t) {
case OUI_FORMAT :
break;
case IANA_ENTERPRISE_NUMBER :
break;
case RANDOM :
// if (d != 0) {
// ... | java | protected final void checkIntegrity () throws InternetSCSIException {
String exceptionMessage = "";
switch (t) {
case OUI_FORMAT :
break;
case IANA_ENTERPRISE_NUMBER :
break;
case RANDOM :
// if (d != 0) {
// ... | [
"protected",
"final",
"void",
"checkIntegrity",
"(",
")",
"throws",
"InternetSCSIException",
"{",
"String",
"exceptionMessage",
"=",
"\"\"",
";",
"switch",
"(",
"t",
")",
"{",
"case",
"OUI_FORMAT",
":",
"break",
";",
"case",
"IANA_ENTERPRISE_NUMBER",
":",
"break... | This method checks, if all fields are valid. In these cases an exception will be thrown.
@throws InternetSCSIException If the integrity is violated. | [
"This",
"method",
"checks",
"if",
"all",
"fields",
"are",
"valid",
".",
"In",
"these",
"cases",
"an",
"exception",
"will",
"be",
"thrown",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/login/ISID.java#L467-L498 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/ProtocolDataUnit.java | ProtocolDataUnit.serialize | public final ByteBuffer serialize () throws InternetSCSIException , IOException {
basicHeaderSegment.getParser().checkIntegrity();
final ByteBuffer pdu = ByteBuffer.allocate(calcSize());
int offset = 0;
offset += basicHeaderSegment.serialize(pdu, offset);
if (LOGGER.isTraceEn... | java | public final ByteBuffer serialize () throws InternetSCSIException , IOException {
basicHeaderSegment.getParser().checkIntegrity();
final ByteBuffer pdu = ByteBuffer.allocate(calcSize());
int offset = 0;
offset += basicHeaderSegment.serialize(pdu, offset);
if (LOGGER.isTraceEn... | [
"public",
"final",
"ByteBuffer",
"serialize",
"(",
")",
"throws",
"InternetSCSIException",
",",
"IOException",
"{",
"basicHeaderSegment",
".",
"getParser",
"(",
")",
".",
"checkIntegrity",
"(",
")",
";",
"final",
"ByteBuffer",
"pdu",
"=",
"ByteBuffer",
".",
"all... | Serialize all informations of this PDU object to its byte representation.
@return The byte representation of this PDU.
@throws InternetSCSIException If any violation of the iSCSI-Standard emerge.
@throws IOException if an I/O error occurs. | [
"Serialize",
"all",
"informations",
"of",
"this",
"PDU",
"object",
"to",
"its",
"byte",
"representation",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/ProtocolDataUnit.java#L123-L154 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/ProtocolDataUnit.java | ProtocolDataUnit.serializeAdditionalHeaderSegments | private final int serializeAdditionalHeaderSegments (final ByteBuffer dst, final int offset) throws InternetSCSIException {
int off = offset;
for (AdditionalHeaderSegment ahs : additionalHeaderSegments) {
off += ahs.serialize(dst, off);
}
return off - offset;
} | java | private final int serializeAdditionalHeaderSegments (final ByteBuffer dst, final int offset) throws InternetSCSIException {
int off = offset;
for (AdditionalHeaderSegment ahs : additionalHeaderSegments) {
off += ahs.serialize(dst, off);
}
return off - offset;
} | [
"private",
"final",
"int",
"serializeAdditionalHeaderSegments",
"(",
"final",
"ByteBuffer",
"dst",
",",
"final",
"int",
"offset",
")",
"throws",
"InternetSCSIException",
"{",
"int",
"off",
"=",
"offset",
";",
"for",
"(",
"AdditionalHeaderSegment",
"ahs",
":",
"add... | Serialize all the contained additional header segments to the destination array starting from the given offset.
@param dst The destination array to write in.
@param offset The offset to start to write in <code>dst</code>.
@return The written length.
@throws InternetSCSIException If any violation of the iSCSI-Standard ... | [
"Serialize",
"all",
"the",
"contained",
"additional",
"header",
"segments",
"to",
"the",
"destination",
"array",
"starting",
"from",
"the",
"given",
"offset",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/ProtocolDataUnit.java#L250-L258 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/ProtocolDataUnit.java | ProtocolDataUnit.clear | public final void clear () {
basicHeaderSegment.clear();
headerDigest.reset();
additionalHeaderSegments.clear();
dataSegment.clear();
dataSegment.flip();
dataDigest.reset();
} | java | public final void clear () {
basicHeaderSegment.clear();
headerDigest.reset();
additionalHeaderSegments.clear();
dataSegment.clear();
dataSegment.flip();
dataDigest.reset();
} | [
"public",
"final",
"void",
"clear",
"(",
")",
"{",
"basicHeaderSegment",
".",
"clear",
"(",
")",
";",
"headerDigest",
".",
"reset",
"(",
")",
";",
"additionalHeaderSegments",
".",
"clear",
"(",
")",
";",
"dataSegment",
".",
"clear",
"(",
")",
";",
"dataS... | Clears all stored content of this ProtocolDataUnit object. | [
"Clears",
"all",
"stored",
"content",
"of",
"this",
"ProtocolDataUnit",
"object",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/ProtocolDataUnit.java#L404-L416 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/ProtocolDataUnit.java | ProtocolDataUnit.setDataSegment | public final void setDataSegment (final IDataSegmentChunk chunk) {
if (chunk == null) { throw new NullPointerException(); }
dataSegment = ByteBuffer.allocate(chunk.getTotalLength());
dataSegment.put(chunk.getData());
basicHeaderSegment.setDataSegmentLength(chunk.getLength());
} | java | public final void setDataSegment (final IDataSegmentChunk chunk) {
if (chunk == null) { throw new NullPointerException(); }
dataSegment = ByteBuffer.allocate(chunk.getTotalLength());
dataSegment.put(chunk.getData());
basicHeaderSegment.setDataSegmentLength(chunk.getLength());
} | [
"public",
"final",
"void",
"setDataSegment",
"(",
"final",
"IDataSegmentChunk",
"chunk",
")",
"{",
"if",
"(",
"chunk",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"dataSegment",
"=",
"ByteBuffer",
".",
"allocate",
"(",... | Sets a new data segment in this PDU.
@param chunk The new data segment of this <code>ProtocolDataUnit</code> object. | [
"Sets",
"a",
"new",
"data",
"segment",
"in",
"this",
"PDU",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/ProtocolDataUnit.java#L464-L471 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/scsi/inquiry/DeviceIdentificationVpdPage.java | DeviceIdentificationVpdPage.getPageLength | private short getPageLength () {
short pageLength = 0;
for (int i = 0; i < identificationDescriptors.length; ++i) {
pageLength += identificationDescriptors[i].size();
}
return pageLength;
} | java | private short getPageLength () {
short pageLength = 0;
for (int i = 0; i < identificationDescriptors.length; ++i) {
pageLength += identificationDescriptors[i].size();
}
return pageLength;
} | [
"private",
"short",
"getPageLength",
"(",
")",
"{",
"short",
"pageLength",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"identificationDescriptors",
".",
"length",
";",
"++",
"i",
")",
"{",
"pageLength",
"+=",
"identificationDescriptors"... | Returns the combined length of all contained IDENTIFICATION DESCRIPTORs.
@return the combined length of all contained IDENTIFICATION DESCRIPTORs | [
"Returns",
"the",
"combined",
"length",
"of",
"all",
"contained",
"IDENTIFICATION",
"DESCRIPTORs",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/scsi/inquiry/DeviceIdentificationVpdPage.java#L96-L102 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/scsi/SCSICommandParser.java | SCSICommandParser.setCommandDescriptorBlock | public final void setCommandDescriptorBlock (final ByteBuffer newCDB) {
if (newCDB.limit() - newCDB.position() > CDB_SIZE) { throw new IllegalArgumentException("Buffer cannot be longer than 16 bytes, because AHS-support is not implemented."); }
commandDescriptorBlock = newCDB;
} | java | public final void setCommandDescriptorBlock (final ByteBuffer newCDB) {
if (newCDB.limit() - newCDB.position() > CDB_SIZE) { throw new IllegalArgumentException("Buffer cannot be longer than 16 bytes, because AHS-support is not implemented."); }
commandDescriptorBlock = newCDB;
} | [
"public",
"final",
"void",
"setCommandDescriptorBlock",
"(",
"final",
"ByteBuffer",
"newCDB",
")",
"{",
"if",
"(",
"newCDB",
".",
"limit",
"(",
")",
"-",
"newCDB",
".",
"position",
"(",
")",
">",
"CDB_SIZE",
")",
"{",
"throw",
"new",
"IllegalArgumentExceptio... | Sets the new Command Descriptor Block.
@param newCDB The new Command Descriptor Block. | [
"Sets",
"the",
"new",
"Command",
"Descriptor",
"Block",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/scsi/SCSICommandParser.java#L355-L359 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/storage/RandomAccessStorageModule.java | RandomAccessStorageModule.createStorageVolume | private static synchronized boolean createStorageVolume (final File pToCreate, final long pLength) throws IOException {
FileOutputStream outStream = null;
try {
// if file exists, remove it after questioning.
if (pToCreate.exists()) {
if (!pToCreate.delete())... | java | private static synchronized boolean createStorageVolume (final File pToCreate, final long pLength) throws IOException {
FileOutputStream outStream = null;
try {
// if file exists, remove it after questioning.
if (pToCreate.exists()) {
if (!pToCreate.delete())... | [
"private",
"static",
"synchronized",
"boolean",
"createStorageVolume",
"(",
"final",
"File",
"pToCreate",
",",
"final",
"long",
"pLength",
")",
"throws",
"IOException",
"{",
"FileOutputStream",
"outStream",
"=",
"null",
";",
"try",
"{",
"// if file exists, remove it a... | Creating a new file if not existing at the path defined in the config. Note that it is advised to create the file
beforehand.
@param pConf configuration to be updated
@return true if creation successful, false if file already exists.
@throws IOException if anything weird happens | [
"Creating",
"a",
"new",
"file",
"if",
"not",
"existing",
"at",
"the",
"path",
"defined",
"in",
"the",
"config",
".",
"Note",
"that",
"it",
"is",
"advised",
"to",
"create",
"the",
"file",
"beforehand",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/storage/RandomAccessStorageModule.java#L153-L190 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/storage/RandomAccessStorageModule.java | RandomAccessStorageModule.recursiveDelete | public static boolean recursiveDelete (final File pFile) {
if (pFile.isDirectory()) {
for (final File child : pFile.listFiles()) {
if (!recursiveDelete(child)) { return false; }
}
}
return pFile.delete();
} | java | public static boolean recursiveDelete (final File pFile) {
if (pFile.isDirectory()) {
for (final File child : pFile.listFiles()) {
if (!recursiveDelete(child)) { return false; }
}
}
return pFile.delete();
} | [
"public",
"static",
"boolean",
"recursiveDelete",
"(",
"final",
"File",
"pFile",
")",
"{",
"if",
"(",
"pFile",
".",
"isDirectory",
"(",
")",
")",
"{",
"for",
"(",
"final",
"File",
"child",
":",
"pFile",
".",
"listFiles",
"(",
")",
")",
"{",
"if",
"("... | Deleting a storage recursive. Used for deleting a databases
@param pFile which should be deleted included descendants
@return true if delete is valid | [
"Deleting",
"a",
"storage",
"recursive",
".",
"Used",
"for",
"deleting",
"a",
"databases"
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/storage/RandomAccessStorageModule.java#L198-L205 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/datasegment/TextParameterDataSegment.java | TextParameterDataSegment.add | public final void add (final OperationalTextKey textKey, final String value) {
final String s = textKey.value() + KEY_VALUE_DELIMITER + value + PAIR_DELIMITER;
resizeBuffer(s.length(), true);
dataBuffer.put(s.getBytes());
isDirty = true;
} | java | public final void add (final OperationalTextKey textKey, final String value) {
final String s = textKey.value() + KEY_VALUE_DELIMITER + value + PAIR_DELIMITER;
resizeBuffer(s.length(), true);
dataBuffer.put(s.getBytes());
isDirty = true;
} | [
"public",
"final",
"void",
"add",
"(",
"final",
"OperationalTextKey",
"textKey",
",",
"final",
"String",
"value",
")",
"{",
"final",
"String",
"s",
"=",
"textKey",
".",
"value",
"(",
")",
"+",
"KEY_VALUE_DELIMITER",
"+",
"value",
"+",
"PAIR_DELIMITER",
";",
... | Add a given operation text keys with the given value to the key value pairs.
@param textKey One of the valid operation text keys listed above.
@param value The value of this operation text key.
@see de.unikn.inf.disy.blockdebix.iscsi.parser.datasegment.OperationalTextKey | [
"Add",
"a",
"given",
"operation",
"text",
"keys",
"with",
"the",
"given",
"value",
"to",
"the",
"key",
"value",
"pairs",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/datasegment/TextParameterDataSegment.java#L103-L110 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/scsi/sense/SenseData.java | SenseData.getReponseCodeFor | public static final int getReponseCodeFor (final ErrorType errorType, final SenseDataFormat senseDataFormat) {
if (senseDataFormat == SenseDataFormat.FIXED) {
if (errorType == ErrorType.CURRENT)
return 0x70;
else
// errorType == DEFERRED
... | java | public static final int getReponseCodeFor (final ErrorType errorType, final SenseDataFormat senseDataFormat) {
if (senseDataFormat == SenseDataFormat.FIXED) {
if (errorType == ErrorType.CURRENT)
return 0x70;
else
// errorType == DEFERRED
... | [
"public",
"static",
"final",
"int",
"getReponseCodeFor",
"(",
"final",
"ErrorType",
"errorType",
",",
"final",
"SenseDataFormat",
"senseDataFormat",
")",
"{",
"if",
"(",
"senseDataFormat",
"==",
"SenseDataFormat",
".",
"FIXED",
")",
"{",
"if",
"(",
"errorType",
... | Returns the proper response code for the given error type and sense data format.
@param errorType a sense data error type
@param senseDataFormat a sense data format
@return the proper response code | [
"Returns",
"the",
"proper",
"response",
"code",
"for",
"the",
"given",
"error",
"type",
"and",
"sense",
"data",
"format",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/scsi/sense/SenseData.java#L77-L94 | train |
sebastiangraf/jSCSI | bundles/targetExtensions/scsi/src/org/jscsi/scsi/protocol/mode/ModePageRegistry.java | ModePageRegistry.get | public Collection<ModePage> get(boolean subPages)
{
List<ModePage> value = new LinkedList<ModePage>();
for (Map<Integer, ModePage> pagelist : pages.values())
{
for (ModePage page : pagelist.values())
{
if (page.getSubPageCode() == 0x00)
{
... | java | public Collection<ModePage> get(boolean subPages)
{
List<ModePage> value = new LinkedList<ModePage>();
for (Map<Integer, ModePage> pagelist : pages.values())
{
for (ModePage page : pagelist.values())
{
if (page.getSubPageCode() == 0x00)
{
... | [
"public",
"Collection",
"<",
"ModePage",
">",
"get",
"(",
"boolean",
"subPages",
")",
"{",
"List",
"<",
"ModePage",
">",
"value",
"=",
"new",
"LinkedList",
"<",
"ModePage",
">",
"(",
")",
";",
"for",
"(",
"Map",
"<",
"Integer",
",",
"ModePage",
">",
... | Returns all mode pages.
@param subPages Returns all pages, including subpages, if <code>true</code>; returns only
page_0 pages if <code>false</code>. | [
"Returns",
"all",
"mode",
"pages",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/targetExtensions/scsi/src/org/jscsi/scsi/protocol/mode/ModePageRegistry.java#L118-L136 | train |
sebastiangraf/jSCSI | bundles/targetExtensions/scsi/src/org/jscsi/scsi/protocol/mode/ModePageRegistry.java | ModePageRegistry.get | public Collection<ModePage> get(byte pageCode)
{
if (this.contains(pageCode))
return this.pages.get(pageCode).values();
else
return null;
} | java | public Collection<ModePage> get(byte pageCode)
{
if (this.contains(pageCode))
return this.pages.get(pageCode).values();
else
return null;
} | [
"public",
"Collection",
"<",
"ModePage",
">",
"get",
"(",
"byte",
"pageCode",
")",
"{",
"if",
"(",
"this",
".",
"contains",
"(",
"pageCode",
")",
")",
"return",
"this",
".",
"pages",
".",
"get",
"(",
"pageCode",
")",
".",
"values",
"(",
")",
";",
"... | Returns all mode pages with the given page code. | [
"Returns",
"all",
"mode",
"pages",
"with",
"the",
"given",
"page",
"code",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/targetExtensions/scsi/src/org/jscsi/scsi/protocol/mode/ModePageRegistry.java#L141-L147 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/digest/CRCTables.java | CRCTables.getTable | public final int[] getTable (final int offset) {
final int[] table = new int[SIZE_OF_TABLE];
long numberToCalculate;
for (int number = 0; number < table.length; number++) {
numberToCalculate = Integer.reverseBytes(Integer.reverse(number));
table[number] = calculateCRC32... | java | public final int[] getTable (final int offset) {
final int[] table = new int[SIZE_OF_TABLE];
long numberToCalculate;
for (int number = 0; number < table.length; number++) {
numberToCalculate = Integer.reverseBytes(Integer.reverse(number));
table[number] = calculateCRC32... | [
"public",
"final",
"int",
"[",
"]",
"getTable",
"(",
"final",
"int",
"offset",
")",
"{",
"final",
"int",
"[",
"]",
"table",
"=",
"new",
"int",
"[",
"SIZE_OF_TABLE",
"]",
";",
"long",
"numberToCalculate",
";",
"for",
"(",
"int",
"number",
"=",
"0",
";... | Returns all remainders of the polynomial division for the given offset.
@param offset The numbers of bits to shift, e.g. for <code>A</code> offset is <code>56</code>, for <code>D</code>
<code>32</code>.
@return The CRC table with all remainders for the given offset. | [
"Returns",
"all",
"remainders",
"of",
"the",
"polynomial",
"division",
"for",
"the",
"given",
"offset",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/digest/CRCTables.java#L83-L94 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/AbstractMessageParser.java | AbstractMessageParser.deserializeBasicHeaderSegment | final void deserializeBasicHeaderSegment (final ByteBuffer pdu) throws InternetSCSIException {
deserializeBytes1to3(pdu.getInt() & FIRST_SPECIFIC_FIELD_MASK);
pdu.position(BasicHeaderSegment.BYTES_8_11);
deserializeBytes8to11(pdu.getInt());
deserializeBytes12to15(pdu.getInt());
... | java | final void deserializeBasicHeaderSegment (final ByteBuffer pdu) throws InternetSCSIException {
deserializeBytes1to3(pdu.getInt() & FIRST_SPECIFIC_FIELD_MASK);
pdu.position(BasicHeaderSegment.BYTES_8_11);
deserializeBytes8to11(pdu.getInt());
deserializeBytes12to15(pdu.getInt());
... | [
"final",
"void",
"deserializeBasicHeaderSegment",
"(",
"final",
"ByteBuffer",
"pdu",
")",
"throws",
"InternetSCSIException",
"{",
"deserializeBytes1to3",
"(",
"pdu",
".",
"getInt",
"(",
")",
"&",
"FIRST_SPECIFIC_FIELD_MASK",
")",
";",
"pdu",
".",
"position",
"(",
... | This method defines the order of the parsing process of the operation code specific fields and check their
integtity.
@param pdu Array which contains the total Protocol Data Unit.
@throws InternetSCSIException If any violation of the iSCSI-Standard emerge. | [
"This",
"method",
"defines",
"the",
"order",
"of",
"the",
"parsing",
"process",
"of",
"the",
"operation",
"code",
"specific",
"fields",
"and",
"check",
"their",
"integtity",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/AbstractMessageParser.java#L89-L103 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/AbstractMessageParser.java | AbstractMessageParser.serializeBasicHeaderSegment | final void serializeBasicHeaderSegment (final ByteBuffer dst, final int offset) throws InternetSCSIException {
dst.position(offset);
dst.putInt(offset, dst.getInt() | serializeBytes1to3());
dst.position(offset + BasicHeaderSegment.BYTES_8_11);
dst.putInt(serializeBytes8to11());
... | java | final void serializeBasicHeaderSegment (final ByteBuffer dst, final int offset) throws InternetSCSIException {
dst.position(offset);
dst.putInt(offset, dst.getInt() | serializeBytes1to3());
dst.position(offset + BasicHeaderSegment.BYTES_8_11);
dst.putInt(serializeBytes8to11());
... | [
"final",
"void",
"serializeBasicHeaderSegment",
"(",
"final",
"ByteBuffer",
"dst",
",",
"final",
"int",
"offset",
")",
"throws",
"InternetSCSIException",
"{",
"dst",
".",
"position",
"(",
"offset",
")",
";",
"dst",
".",
"putInt",
"(",
"offset",
",",
"dst",
"... | This method serializes the whole BHS to its byte representation.
@param dst The destination <code>ByteBuffer</code> to write to.
@param offset The start offset in <code>dst</code>.
@throws InternetSCSIException If any violation of the iSCSI-Standard emerge. | [
"This",
"method",
"serializes",
"the",
"whole",
"BHS",
"to",
"its",
"byte",
"representation",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/AbstractMessageParser.java#L112-L129 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java | Configuration.getSetting | public final String getSetting (final String targetName, final int connectionID, final OperationalTextKey textKey) throws OperationalTextKeyException {
try {
final SessionConfiguration sc;
synchronized (sessionConfigs) {
sc = sessionConfigs.get(targetName);
... | java | public final String getSetting (final String targetName, final int connectionID, final OperationalTextKey textKey) throws OperationalTextKeyException {
try {
final SessionConfiguration sc;
synchronized (sessionConfigs) {
sc = sessionConfigs.get(targetName);
... | [
"public",
"final",
"String",
"getSetting",
"(",
"final",
"String",
"targetName",
",",
"final",
"int",
"connectionID",
",",
"final",
"OperationalTextKey",
"textKey",
")",
"throws",
"OperationalTextKeyException",
"{",
"try",
"{",
"final",
"SessionConfiguration",
"sc",
... | Returns the value of a single parameter, instead of all values.
@param targetName Name of the iSCSI Target to connect.
@param connectionID The ID of the connection to retrieve.
@param textKey The name of the parameter.
@return The value of the given parameter.
@throws OperationalTextKeyException If the given parameter... | [
"Returns",
"the",
"value",
"of",
"a",
"single",
"parameter",
"instead",
"of",
"all",
"values",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java#L205-L235 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java | Configuration.getSessionSetting | public final String getSessionSetting (final String targetName, final OperationalTextKey textKey) throws OperationalTextKeyException {
return getSetting(targetName, -1, textKey);
} | java | public final String getSessionSetting (final String targetName, final OperationalTextKey textKey) throws OperationalTextKeyException {
return getSetting(targetName, -1, textKey);
} | [
"public",
"final",
"String",
"getSessionSetting",
"(",
"final",
"String",
"targetName",
",",
"final",
"OperationalTextKey",
"textKey",
")",
"throws",
"OperationalTextKeyException",
"{",
"return",
"getSetting",
"(",
"targetName",
",",
"-",
"1",
",",
"textKey",
")",
... | Returns the value of a single parameter. It can only return session and global parameters.
@param targetName Name of the iSCSI Target to connect.
@param textKey The name of the parameter.
@return The value of the given parameter.
@throws OperationalTextKeyException If the given parameter cannot be found. | [
"Returns",
"the",
"value",
"of",
"a",
"single",
"parameter",
".",
"It",
"can",
"only",
"return",
"session",
"and",
"global",
"parameters",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java#L283-L286 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java | Configuration.update | public final void update (final String targetName, final int connectionID, final SettingsMap response) throws NoSuchSessionException {
final SessionConfiguration sc;
synchronized (sessionConfigs) {
sc = sessionConfigs.get(targetName);
synchronized (sc) {
if (sc ... | java | public final void update (final String targetName, final int connectionID, final SettingsMap response) throws NoSuchSessionException {
final SessionConfiguration sc;
synchronized (sessionConfigs) {
sc = sessionConfigs.get(targetName);
synchronized (sc) {
if (sc ... | [
"public",
"final",
"void",
"update",
"(",
"final",
"String",
"targetName",
",",
"final",
"int",
"connectionID",
",",
"final",
"SettingsMap",
"response",
")",
"throws",
"NoSuchSessionException",
"{",
"final",
"SessionConfiguration",
"sc",
";",
"synchronized",
"(",
... | Updates the stored settings of a connection with these values from the response of the iSCSI Target.
@param targetName The name of the iSCSI Target.
@param connectionID The ID of the connection within this iSCSI Target.
@param response The response settings.
@throws NoSuchSessionException if a session with this target... | [
"Updates",
"the",
"stored",
"settings",
"of",
"a",
"connection",
"with",
"these",
"values",
"from",
"the",
"response",
"of",
"the",
"iSCSI",
"Target",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java#L312-L346 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java | Configuration.parseSettings | private final void parseSettings (final Element root) {
if (root == null) { throw new NullPointerException(); }
clear();
parseGlobalSettings(root);
parseTargetSpecificSettings(root);
} | java | private final void parseSettings (final Element root) {
if (root == null) { throw new NullPointerException(); }
clear();
parseGlobalSettings(root);
parseTargetSpecificSettings(root);
} | [
"private",
"final",
"void",
"parseSettings",
"(",
"final",
"Element",
"root",
")",
"{",
"if",
"(",
"root",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"clear",
"(",
")",
";",
"parseGlobalSettings",
"(",
"root",
")"... | Parses all settings form the main configuration file.
@param root The root element of the configuration. | [
"Parses",
"all",
"settings",
"form",
"the",
"main",
"configuration",
"file",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java#L392-L399 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java | Configuration.parseGlobalSettings | private final void parseGlobalSettings (final Element root) {
final NodeList globalConfiguration = root.getElementsByTagName(ELEMENT_GLOBAL);
final ResultFunctionFactory resultFunctionFactory = new ResultFunctionFactory();
Node parameter;
NodeList parameters;
NamedNodeMap attri... | java | private final void parseGlobalSettings (final Element root) {
final NodeList globalConfiguration = root.getElementsByTagName(ELEMENT_GLOBAL);
final ResultFunctionFactory resultFunctionFactory = new ResultFunctionFactory();
Node parameter;
NodeList parameters;
NamedNodeMap attri... | [
"private",
"final",
"void",
"parseGlobalSettings",
"(",
"final",
"Element",
"root",
")",
"{",
"final",
"NodeList",
"globalConfiguration",
"=",
"root",
".",
"getElementsByTagName",
"(",
"ELEMENT_GLOBAL",
")",
";",
"final",
"ResultFunctionFactory",
"resultFunctionFactory"... | Parses all global settings form the main configuration file.
@param root The root element of the configuration. | [
"Parses",
"all",
"global",
"settings",
"form",
"the",
"main",
"configuration",
"file",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java#L406-L437 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java | Configuration.parseTargetSpecificSettings | private final void parseTargetSpecificSettings (final Element root) {
final NodeList targets = root.getElementsByTagName(ELEMENT_TARGET);
Node target;
Node parameter;
NodeList parameters;
try {
for (int i = 0; i < targets.getLength(); i++) {
target ... | java | private final void parseTargetSpecificSettings (final Element root) {
final NodeList targets = root.getElementsByTagName(ELEMENT_TARGET);
Node target;
Node parameter;
NodeList parameters;
try {
for (int i = 0; i < targets.getLength(); i++) {
target ... | [
"private",
"final",
"void",
"parseTargetSpecificSettings",
"(",
"final",
"Element",
"root",
")",
"{",
"final",
"NodeList",
"targets",
"=",
"root",
".",
"getElementsByTagName",
"(",
"ELEMENT_TARGET",
")",
";",
"Node",
"target",
";",
"Node",
"parameter",
";",
"Nod... | Parses all target-specific settings form the main configuration file.
@param root The root element of the configuration. | [
"Parses",
"all",
"target",
"-",
"specific",
"settings",
"form",
"the",
"main",
"configuration",
"file",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/Configuration.java#L444-L481 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/util/Debug.java | Debug.byteBufferToString | public static String byteBufferToString (final ByteBuffer buffer) {
if (buffer == null) return "null";
final int numberOfBytes = buffer.limit();
final StringBuilder sb = new StringBuilder();
buffer.position(0);
int value;
for (int i = 1; i <= numberOfBytes; ++... | java | public static String byteBufferToString (final ByteBuffer buffer) {
if (buffer == null) return "null";
final int numberOfBytes = buffer.limit();
final StringBuilder sb = new StringBuilder();
buffer.position(0);
int value;
for (int i = 1; i <= numberOfBytes; ++... | [
"public",
"static",
"String",
"byteBufferToString",
"(",
"final",
"ByteBuffer",
"buffer",
")",
"{",
"if",
"(",
"buffer",
"==",
"null",
")",
"return",
"\"null\"",
";",
"final",
"int",
"numberOfBytes",
"=",
"buffer",
".",
"limit",
"(",
")",
";",
"final",
"St... | Returns a string containing the buffered values in the defined format.
@param buffer contains the bytes to return in the {@link String}
@return a {@link String} with the values in tabular arrangement | [
"Returns",
"a",
"string",
"containing",
"the",
"buffered",
"values",
"in",
"the",
"defined",
"format",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/util/Debug.java#L38-L59 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/connection/phase/TargetLoginPhase.java | TargetLoginPhase.execute | @Override
public boolean execute (ProtocolDataUnit pdu) throws IOException , InterruptedException , InternetSCSIException , DigestException , SettingsException {
// begin login negotiation
final ConnectionSettingsNegotiator negotiator = connection.getConnectionSettingsNegotiator();
whi... | java | @Override
public boolean execute (ProtocolDataUnit pdu) throws IOException , InterruptedException , InternetSCSIException , DigestException , SettingsException {
// begin login negotiation
final ConnectionSettingsNegotiator negotiator = connection.getConnectionSettingsNegotiator();
whi... | [
"@",
"Override",
"public",
"boolean",
"execute",
"(",
"ProtocolDataUnit",
"pdu",
")",
"throws",
"IOException",
",",
"InterruptedException",
",",
"InternetSCSIException",
",",
"DigestException",
",",
"SettingsException",
"{",
"// begin login negotiation\r",
"final",
"Conne... | Starts the login phase.
@param pdu {@inheritDoc}
@return {@inheritDoc}
@throws OperationNotSupportedException {@inheritDoc}
@throws IOException {@inheritDoc}
@throws InterruptedException {@inheritDoc}
@throws InternetSCSIException {@inheritDoc}
@throws DigestException {@inheritDoc}
@throws SettingsException {@inheritD... | [
"Starts",
"the",
"login",
"phase",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/connection/phase/TargetLoginPhase.java#L75-L154 | train |
sebastiangraf/jSCSI | bundles/targetExtensions/scsi/src/org/jscsi/scsi/tasks/management/DefaultTaskSet.java | DefaultTaskSet.drainTo | public int drainTo(Collection<? super Task> c)
{
if (c == this)
throw new IllegalArgumentException("cannot drain task set into itself");
if (c == null)
throw new NullPointerException("target collection must not be null");
int count = 0;
while (true)
{
... | java | public int drainTo(Collection<? super Task> c)
{
if (c == this)
throw new IllegalArgumentException("cannot drain task set into itself");
if (c == null)
throw new NullPointerException("target collection must not be null");
int count = 0;
while (true)
{
... | [
"public",
"int",
"drainTo",
"(",
"Collection",
"<",
"?",
"super",
"Task",
">",
"c",
")",
"{",
"if",
"(",
"c",
"==",
"this",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"cannot drain task set into itself\"",
")",
";",
"if",
"(",
"c",
"==",
"null... | Removes all available elements from this task set. Any tasks that are blocked will not be
removed. Will cease draining if the thread is interrupted. | [
"Removes",
"all",
"available",
"elements",
"from",
"this",
"task",
"set",
".",
"Any",
"tasks",
"that",
"are",
"blocked",
"will",
"not",
"be",
"removed",
".",
"Will",
"cease",
"draining",
"if",
"the",
"thread",
"is",
"interrupted",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/targetExtensions/scsi/src/org/jscsi/scsi/tasks/management/DefaultTaskSet.java#L612-L636 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/utils/Utils.java | Utils.indent | private static final void indent (final StringBuilder sb, final int indent) {
for (int i = 0; i < indent; i++) {
sb.append(LOG_OUT_INDENT);
}
} | java | private static final void indent (final StringBuilder sb, final int indent) {
for (int i = 0; i < indent; i++) {
sb.append(LOG_OUT_INDENT);
}
} | [
"private",
"static",
"final",
"void",
"indent",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"int",
"indent",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"indent",
";",
"i",
"++",
")",
"{",
"sb",
".",
"append",
"(",
"LOG_OUT_IN... | Appends to a given StringBuilder the given indents depending on the indent level.
@param sb StringBuilder to write in.
@param indent The number (level) of indents. | [
"Appends",
"to",
"a",
"given",
"StringBuilder",
"the",
"given",
"indents",
"depending",
"on",
"the",
"indent",
"level",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/utils/Utils.java#L213-L218 | train |
sebastiangraf/jSCSI | bundles/targetExtensions/scsi/src/org/jscsi/scsi/lu/AbstractLogicalUnit.java | AbstractLogicalUnit.abortTaskSet | public TaskServiceResponse abortTaskSet(Nexus nexus)
{
try
{
this.taskSet.abort(nexus);
return TaskServiceResponse.FUNCTION_COMPLETE;
}
catch (InterruptedException e)
{
return TaskServiceResponse.SERVICE_DELIVERY_OR_TARGET_FAILURE;
}
catch (Illegal... | java | public TaskServiceResponse abortTaskSet(Nexus nexus)
{
try
{
this.taskSet.abort(nexus);
return TaskServiceResponse.FUNCTION_COMPLETE;
}
catch (InterruptedException e)
{
return TaskServiceResponse.SERVICE_DELIVERY_OR_TARGET_FAILURE;
}
catch (Illegal... | [
"public",
"TaskServiceResponse",
"abortTaskSet",
"(",
"Nexus",
"nexus",
")",
"{",
"try",
"{",
"this",
".",
"taskSet",
".",
"abort",
"(",
"nexus",
")",
";",
"return",
"TaskServiceResponse",
".",
"FUNCTION_COMPLETE",
";",
"}",
"catch",
"(",
"InterruptedException",... | is simply attempting to remove a task from the scheduler | [
"is",
"simply",
"attempting",
"to",
"remove",
"a",
"task",
"from",
"the",
"scheduler"
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/targetExtensions/scsi/src/org/jscsi/scsi/lu/AbstractLogicalUnit.java#L170-L185 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/scsi/modeSense/ModeParameterListBuilder.java | ModeParameterListBuilder.checkIntegrity | boolean checkIntegrity () {
if (headerType == null) return false;
if (headerType == HeaderType.MODE_PARAMETER_HEADER_6 && longLba) return false;
return true;
} | java | boolean checkIntegrity () {
if (headerType == null) return false;
if (headerType == HeaderType.MODE_PARAMETER_HEADER_6 && longLba) return false;
return true;
} | [
"boolean",
"checkIntegrity",
"(",
")",
"{",
"if",
"(",
"headerType",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"headerType",
"==",
"HeaderType",
".",
"MODE_PARAMETER_HEADER_6",
"&&",
"longLba",
")",
"return",
"false",
";",
"return",
"true",
";",
... | This method is used for checking that all required members are initialized and their respective values compatible
with each other.
@return <code>true</code> if everything is fine, <code>false</code> if not | [
"This",
"method",
"is",
"used",
"for",
"checking",
"that",
"all",
"required",
"members",
"are",
"initialized",
"and",
"their",
"respective",
"values",
"compatible",
"with",
"each",
"other",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/scsi/modeSense/ModeParameterListBuilder.java#L71-L75 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/connection/Connection.java | Connection.update | public final void update (final SettingsMap response) throws NoSuchSessionException {
configuration.update(referenceSession.getTargetName(), connectionID, response);
} | java | public final void update (final SettingsMap response) throws NoSuchSessionException {
configuration.update(referenceSession.getTargetName(), connectionID, response);
} | [
"public",
"final",
"void",
"update",
"(",
"final",
"SettingsMap",
"response",
")",
"throws",
"NoSuchSessionException",
"{",
"configuration",
".",
"update",
"(",
"referenceSession",
".",
"getTargetName",
"(",
")",
",",
"connectionID",
",",
"response",
")",
";",
"... | Updates all entries of the given response key-values with the stored settings of this instance.
@param response The settings of the response.
@throws NoSuchSessionException if a session with this target name is not open. | [
"Updates",
"all",
"entries",
"of",
"the",
"given",
"response",
"key",
"-",
"values",
"with",
"the",
"stored",
"settings",
"of",
"this",
"instance",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/connection/Connection.java#L118-L121 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/connection/Connection.java | Connection.nextState | public final void nextState (final IState newState) throws InternetSCSIException {
this.state = newState;
if (this.state != null) {
do {
this.state.execute();
LOGGER.info("State is following: " + this.state.nextStateFollowing());
} while (this.sta... | java | public final void nextState (final IState newState) throws InternetSCSIException {
this.state = newState;
if (this.state != null) {
do {
this.state.execute();
LOGGER.info("State is following: " + this.state.nextStateFollowing());
} while (this.sta... | [
"public",
"final",
"void",
"nextState",
"(",
"final",
"IState",
"newState",
")",
"throws",
"InternetSCSIException",
"{",
"this",
".",
"state",
"=",
"newState",
";",
"if",
"(",
"this",
".",
"state",
"!=",
"null",
")",
"{",
"do",
"{",
"this",
".",
"state",... | Switch to the new state. Start point of the state pattern. All states are computed one after another.
@param newState The new state.
@throws InternetSCSIException of any kind | [
"Switch",
"to",
"the",
"new",
"state",
".",
"Start",
"point",
"of",
"the",
"state",
"pattern",
".",
"All",
"states",
"are",
"computed",
"one",
"after",
"another",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/connection/Connection.java#L211-L221 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/connection/Connection.java | Connection.send | public final void send (final ProtocolDataUnit protocolDataUnit) throws InternetSCSIException {
try {
senderReceiver.sendOverWire(protocolDataUnit);
} catch (IOException e) {
throw new InternetSCSIException(e);
} catch (InterruptedException e) {
throw new Int... | java | public final void send (final ProtocolDataUnit protocolDataUnit) throws InternetSCSIException {
try {
senderReceiver.sendOverWire(protocolDataUnit);
} catch (IOException e) {
throw new InternetSCSIException(e);
} catch (InterruptedException e) {
throw new Int... | [
"public",
"final",
"void",
"send",
"(",
"final",
"ProtocolDataUnit",
"protocolDataUnit",
")",
"throws",
"InternetSCSIException",
"{",
"try",
"{",
"senderReceiver",
".",
"sendOverWire",
"(",
"protocolDataUnit",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
... | Enqueue this protocol data unit to the end of the sending queue.
@param protocolDataUnit The protocol data unit to add.
@throws InternetSCSIException for nearly everything | [
"Enqueue",
"this",
"protocol",
"data",
"unit",
"to",
"the",
"end",
"of",
"the",
"sending",
"queue",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/connection/Connection.java#L273-L282 | train |
sebastiangraf/jSCSI | bundles/initiator/src/main/java/org/jscsi/initiator/connection/Connection.java | Connection.send | public final void send (final Queue<ProtocolDataUnit> protocolDataUnits) throws InternetSCSIException {
for (final ProtocolDataUnit unit : protocolDataUnits) {
send(unit);
}
} | java | public final void send (final Queue<ProtocolDataUnit> protocolDataUnits) throws InternetSCSIException {
for (final ProtocolDataUnit unit : protocolDataUnits) {
send(unit);
}
} | [
"public",
"final",
"void",
"send",
"(",
"final",
"Queue",
"<",
"ProtocolDataUnit",
">",
"protocolDataUnits",
")",
"throws",
"InternetSCSIException",
"{",
"for",
"(",
"final",
"ProtocolDataUnit",
"unit",
":",
"protocolDataUnits",
")",
"{",
"send",
"(",
"unit",
")... | Enqueue all protocol data units to the end of the sending queue.
@param protocolDataUnits The list with all protocol data units to add.
@throws InternetSCSIException for nearly everything | [
"Enqueue",
"all",
"protocol",
"data",
"units",
"to",
"the",
"end",
"of",
"the",
"sending",
"queue",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/initiator/src/main/java/org/jscsi/initiator/connection/Connection.java#L290-L295 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/utils/SoftHashMap.java | SoftHashMap.processQueue | @SuppressWarnings ({ "rawtypes", "unchecked" })
private final void processQueue () {
SoftValue<V> softValue;
while ((softValue = (SoftValue) queue.poll()) != null) {
internalMap.remove(softValue.key);
}
} | java | @SuppressWarnings ({ "rawtypes", "unchecked" })
private final void processQueue () {
SoftValue<V> softValue;
while ((softValue = (SoftValue) queue.poll()) != null) {
internalMap.remove(softValue.key);
}
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"private",
"final",
"void",
"processQueue",
"(",
")",
"{",
"SoftValue",
"<",
"V",
">",
"softValue",
";",
"while",
"(",
"(",
"softValue",
"=",
"(",
"SoftValue",
")",
"queue",... | Remove garbage collected soft values with the help of the reference queue. | [
"Remove",
"garbage",
"collected",
"soft",
"values",
"with",
"the",
"help",
"of",
"the",
"reference",
"queue",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/utils/SoftHashMap.java#L175-L182 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/settings/SingleNumericalValue.java | SingleNumericalValue.base64ValueOf | private static final int base64ValueOf (final char c) {
if ('A' <= c && c <= 'Z') return c - 'A';
if ('a' <= c && c <= 'z') return c - 'a' + 26;
if ('0' <= c && c <= '9') return c - '0' + 52;
if (c == '+') return 62;
if (c == '/') return 63;
throw new NumberFormatEx... | java | private static final int base64ValueOf (final char c) {
if ('A' <= c && c <= 'Z') return c - 'A';
if ('a' <= c && c <= 'z') return c - 'a' + 26;
if ('0' <= c && c <= '9') return c - '0' + 52;
if (c == '+') return 62;
if (c == '/') return 63;
throw new NumberFormatEx... | [
"private",
"static",
"final",
"int",
"base64ValueOf",
"(",
"final",
"char",
"c",
")",
"{",
"if",
"(",
"'",
"'",
"<=",
"c",
"&&",
"c",
"<=",
"'",
"'",
")",
"return",
"c",
"-",
"'",
"'",
";",
"if",
"(",
"'",
"'",
"<=",
"c",
"&&",
"c",
"<=",
"... | Returns a character's value in Base64
@param c a character that is assigned a value from 0 to 63 in Base64
@throws NumberFormatException if the parameter is not a Base64 character
@return the character's value in Base64 | [
"Returns",
"a",
"character",
"s",
"value",
"in",
"Base64"
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/settings/SingleNumericalValue.java#L125-L132 | train |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/connection/stage/login/TargetLoginStage.java | TargetLoginStage.sendRejectPdu | protected final void sendRejectPdu (final LoginStatus errorStatus) throws InterruptedException , IOException , InternetSCSIException {
final ProtocolDataUnit rejectPDU = TargetPduFactory.createLoginResponsePdu(false,// transit flag
false,// continueFlag
stageNumber,// currentS... | java | protected final void sendRejectPdu (final LoginStatus errorStatus) throws InterruptedException , IOException , InternetSCSIException {
final ProtocolDataUnit rejectPDU = TargetPduFactory.createLoginResponsePdu(false,// transit flag
false,// continueFlag
stageNumber,// currentS... | [
"protected",
"final",
"void",
"sendRejectPdu",
"(",
"final",
"LoginStatus",
"errorStatus",
")",
"throws",
"InterruptedException",
",",
"IOException",
",",
"InternetSCSIException",
"{",
"final",
"ProtocolDataUnit",
"rejectPDU",
"=",
"TargetPduFactory",
".",
"createLoginRes... | Sends a Login Response PDU informing the initiator that an error has occurred and that the connection must be
closed.
@param errorStatus hints to the cause of the error
@throws InterruptedException
@throws IOException
@throws InternetSCSIException | [
"Sends",
"a",
"Login",
"Response",
"PDU",
"informing",
"the",
"initiator",
"that",
"an",
"error",
"has",
"occurred",
"and",
"that",
"the",
"connection",
"must",
"be",
"closed",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/connection/stage/login/TargetLoginStage.java#L250-L261 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/datasegment/SettingsMap.java | SettingsMap.get | public final String get (final OperationalTextKey textKey) {
if (textKey == null) { throw new NullPointerException(); }
return settingsMap.get(textKey);
} | java | public final String get (final OperationalTextKey textKey) {
if (textKey == null) { throw new NullPointerException(); }
return settingsMap.get(textKey);
} | [
"public",
"final",
"String",
"get",
"(",
"final",
"OperationalTextKey",
"textKey",
")",
"{",
"if",
"(",
"textKey",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"return",
"settingsMap",
".",
"get",
"(",
"textKey",
")",... | Returns the value of the given parameter, which is not parsed.
@param textKey The name of the parameter.
@return The value of this parameter. | [
"Returns",
"the",
"value",
"of",
"the",
"given",
"parameter",
"which",
"is",
"not",
"parsed",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/datasegment/SettingsMap.java#L91-L96 | train |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/datasegment/SettingsMap.java | SettingsMap.asByteBuffer | public final ByteBuffer asByteBuffer () {
final StringBuilder sb = new StringBuilder();
for (Map.Entry<OperationalTextKey , String> e : settingsMap.entrySet()) {
sb.append(e.getKey().value());
sb.append(KEY_VALUE_DELIMITER);
sb.append(e.getValue());
sb.ap... | java | public final ByteBuffer asByteBuffer () {
final StringBuilder sb = new StringBuilder();
for (Map.Entry<OperationalTextKey , String> e : settingsMap.entrySet()) {
sb.append(e.getKey().value());
sb.append(KEY_VALUE_DELIMITER);
sb.append(e.getValue());
sb.ap... | [
"public",
"final",
"ByteBuffer",
"asByteBuffer",
"(",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"OperationalTextKey",
",",
"String",
">",
"e",
":",
"settingsMap",
".",
"entry... | Returns a buffer of the serialized key-value pairs, which are contained in this instance.
@return The serialized key-value pairs. | [
"Returns",
"a",
"buffer",
"of",
"the",
"serialized",
"key",
"-",
"value",
"pairs",
"which",
"are",
"contained",
"in",
"this",
"instance",
"."
] | 6169bfe73f0b15de7d6485453555389e782ae888 | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/datasegment/SettingsMap.java#L265-L276 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tcp/TCPTransportClient.java | TCPTransportClient.initialize | public void initialize() throws IOException, NotInitializedException {
logger.debug("Initialising TCPTransportClient. Origin address is [{}] and destination address is [{}]", origAddress, destAddress);
if (destAddress == null) {
throw new NotInitializedException("Destination address is not set");
... | java | public void initialize() throws IOException, NotInitializedException {
logger.debug("Initialising TCPTransportClient. Origin address is [{}] and destination address is [{}]", origAddress, destAddress);
if (destAddress == null) {
throw new NotInitializedException("Destination address is not set");
... | [
"public",
"void",
"initialize",
"(",
")",
"throws",
"IOException",
",",
"NotInitializedException",
"{",
"logger",
".",
"debug",
"(",
"\"Initialising TCPTransportClient. Origin address is [{}] and destination address is [{}]\"",
",",
"origAddress",
",",
"destAddress",
")",
";"... | Network init socket | [
"Network",
"init",
"socket"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tcp/TCPTransportClient.java#L122-L146 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tcp/TCPTransportClient.java | TCPTransportClient.run | @Override
public void run() {
// Workaround for Issue #4 (http://code.google.com/p/jdiameter/issues/detail?id=4)
// BEGIN WORKAROUND // Give some time to initialization...
int sleepTime = 250;
logger.debug("Sleeping for {}ms before starting transport so that listeners can all be added and ready f... | java | @Override
public void run() {
// Workaround for Issue #4 (http://code.google.com/p/jdiameter/issues/detail?id=4)
// BEGIN WORKAROUND // Give some time to initialization...
int sleepTime = 250;
logger.debug("Sleeping for {}ms before starting transport so that listeners can all be added and ready f... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"// Workaround for Issue #4 (http://code.google.com/p/jdiameter/issues/detail?id=4)\r",
"// BEGIN WORKAROUND // Give some time to initialization...\r",
"int",
"sleepTime",
"=",
"250",
";",
"logger",
".",
"debug",
"(",
"\"... | PCB added logging | [
"PCB",
"added",
"logging"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tcp/TCPTransportClient.java#L187-L258 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tcp/TCPTransportClient.java | TCPTransportClient.append | private void append(byte[] data) {
if (storage.position() + data.length >= storage.capacity()) {
ByteBuffer tmp = ByteBuffer.allocate(storage.limit() + data.length * 2);
byte[] tmpData = new byte[storage.position()];
storage.flip();
storage.get(tmpData);
tmp.put(tmpData);
... | java | private void append(byte[] data) {
if (storage.position() + data.length >= storage.capacity()) {
ByteBuffer tmp = ByteBuffer.allocate(storage.limit() + data.length * 2);
byte[] tmpData = new byte[storage.position()];
storage.flip();
storage.get(tmpData);
tmp.put(tmpData);
... | [
"private",
"void",
"append",
"(",
"byte",
"[",
"]",
"data",
")",
"{",
"if",
"(",
"storage",
".",
"position",
"(",
")",
"+",
"data",
".",
"length",
">=",
"storage",
".",
"capacity",
"(",
")",
")",
"{",
"ByteBuffer",
"tmp",
"=",
"ByteBuffer",
".",
"a... | Adds data to storage
@param data data to add | [
"Adds",
"data",
"to",
"storage"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tcp/TCPTransportClient.java#L369-L390 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/router/RouterImpl.java | RouterImpl.makeRoutingKey | private String makeRoutingKey(Message message) {
String sessionId = message.getSessionId();
return new StringBuilder(sessionId != null ? sessionId : "null").append(message.getEndToEndIdentifier())
.append(message.getHopByHopIdentifier()).toString();
} | java | private String makeRoutingKey(Message message) {
String sessionId = message.getSessionId();
return new StringBuilder(sessionId != null ? sessionId : "null").append(message.getEndToEndIdentifier())
.append(message.getHopByHopIdentifier()).toString();
} | [
"private",
"String",
"makeRoutingKey",
"(",
"Message",
"message",
")",
"{",
"String",
"sessionId",
"=",
"message",
".",
"getSessionId",
"(",
")",
";",
"return",
"new",
"StringBuilder",
"(",
"sessionId",
"!=",
"null",
"?",
"sessionId",
":",
"\"null\"",
")",
"... | PCB - Made better routing algorithm that should not grow all the time | [
"PCB",
"-",
"Made",
"better",
"routing",
"algorithm",
"that",
"should",
"not",
"grow",
"all",
"the",
"time"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/router/RouterImpl.java#L327-L331 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/ExtensionPoint.java | ExtensionPoint.appendElements | public void appendElements(ExtensionPoint... elements) {
List<ExtensionPoint> rc = new ArrayList<ExtensionPoint>();
rc.addAll(Arrays.asList(this.elements));
rc.addAll(Arrays.asList(elements));
this.elements = rc.toArray(new ExtensionPoint[0]);
} | java | public void appendElements(ExtensionPoint... elements) {
List<ExtensionPoint> rc = new ArrayList<ExtensionPoint>();
rc.addAll(Arrays.asList(this.elements));
rc.addAll(Arrays.asList(elements));
this.elements = rc.toArray(new ExtensionPoint[0]);
} | [
"public",
"void",
"appendElements",
"(",
"ExtensionPoint",
"...",
"elements",
")",
"{",
"List",
"<",
"ExtensionPoint",
">",
"rc",
"=",
"new",
"ArrayList",
"<",
"ExtensionPoint",
">",
"(",
")",
";",
"rc",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
... | Append extension point entries
@param elements array of append extension point entries | [
"Append",
"extension",
"point",
"entries"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/ExtensionPoint.java#L251-L256 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/router/WeightedLeastConnectionsRouter.java | WeightedLeastConnectionsRouter.getNumConnections | protected long getNumConnections(IPeer peer) {
if (peer == null) {
return 0;
}
IStatistic stats = peer.getStatistic();
// If no statistics are available, return zero
if (!stats.isEnabled()) {
if (logger.isDebugEnabled()) {
logger.debug("Statistics for peer are disabled. Please e... | java | protected long getNumConnections(IPeer peer) {
if (peer == null) {
return 0;
}
IStatistic stats = peer.getStatistic();
// If no statistics are available, return zero
if (!stats.isEnabled()) {
if (logger.isDebugEnabled()) {
logger.debug("Statistics for peer are disabled. Please e... | [
"protected",
"long",
"getNumConnections",
"(",
"IPeer",
"peer",
")",
"{",
"if",
"(",
"peer",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"IStatistic",
"stats",
"=",
"peer",
".",
"getStatistic",
"(",
")",
";",
"// If no statistics are available, return zer... | Since num connections is not available, determine throughput by reading statistics
and assume the load of the peer
@param peer
@return throughput indicator | [
"Since",
"num",
"connections",
"is",
"not",
"available",
"determine",
"throughput",
"by",
"reading",
"statistics",
"and",
"assume",
"the",
"load",
"of",
"the",
"peer"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/router/WeightedLeastConnectionsRouter.java#L162-L189 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/common/impl/concurrent/ConcurrentFactory.java | ConcurrentFactory.getConfigByName | private Configuration getConfigByName(String name) {
if (config != null) {
for (Configuration c : config) {
if (c != null && c.getStringValue(Parameters.ConcurrentEntityName.ordinal(), "").equals(name)) {
return c;
}
}
}
return null;
} | java | private Configuration getConfigByName(String name) {
if (config != null) {
for (Configuration c : config) {
if (c != null && c.getStringValue(Parameters.ConcurrentEntityName.ordinal(), "").equals(name)) {
return c;
}
}
}
return null;
} | [
"private",
"Configuration",
"getConfigByName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"config",
"!=",
"null",
")",
"{",
"for",
"(",
"Configuration",
"c",
":",
"config",
")",
"{",
"if",
"(",
"c",
"!=",
"null",
"&&",
"c",
".",
"getStringValue",
"(",... | fetch configuration for executor
@param name
@return | [
"fetch",
"configuration",
"for",
"executor"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/common/impl/concurrent/ConcurrentFactory.java#L124-L133 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/UIDGenerator.java | UIDGenerator.nextLong | public long nextLong() {
Delta d = ranges.get();
if (d.start <= d.stop) {
mutex.lock();
value = d.update(value);
mutex.unlock();
}
return d.start++;
} | java | public long nextLong() {
Delta d = ranges.get();
if (d.start <= d.stop) {
mutex.lock();
value = d.update(value);
mutex.unlock();
}
return d.start++;
} | [
"public",
"long",
"nextLong",
"(",
")",
"{",
"Delta",
"d",
"=",
"ranges",
".",
"get",
"(",
")",
";",
"if",
"(",
"d",
".",
"start",
"<=",
"d",
".",
"stop",
")",
"{",
"mutex",
".",
"lock",
"(",
")",
";",
"value",
"=",
"d",
".",
"update",
"(",
... | Return next uid as long
@return uid as long | [
"Return",
"next",
"uid",
"as",
"long"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/UIDGenerator.java#L107-L115 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/IPConverter.java | IPConverter.InetAddressByIPv4 | public static InetAddress InetAddressByIPv4(String address) {
StringTokenizer addressTokens = new StringTokenizer(address, ".");
byte[] bytes;
if (addressTokens.countTokens() == 4) {
bytes = new byte[]{
getByBytes(addressTokens),
getByBytes(addressTokens),
getByByt... | java | public static InetAddress InetAddressByIPv4(String address) {
StringTokenizer addressTokens = new StringTokenizer(address, ".");
byte[] bytes;
if (addressTokens.countTokens() == 4) {
bytes = new byte[]{
getByBytes(addressTokens),
getByBytes(addressTokens),
getByByt... | [
"public",
"static",
"InetAddress",
"InetAddressByIPv4",
"(",
"String",
"address",
")",
"{",
"StringTokenizer",
"addressTokens",
"=",
"new",
"StringTokenizer",
"(",
"address",
",",
"\".\"",
")",
";",
"byte",
"[",
"]",
"bytes",
";",
"if",
"(",
"addressTokens",
"... | Convert defined string to IPv4 object instance
@param address string representation of ip address
@return IPv4 object instance | [
"Convert",
"defined",
"string",
"to",
"IPv4",
"object",
"instance"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/IPConverter.java#L63-L83 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/IPConverter.java | IPConverter.InetAddressByIPv6 | public static InetAddress InetAddressByIPv6(String address) {
StringTokenizer addressTokens = new StringTokenizer(address, ":");
byte[] bytes = new byte[16];
if (addressTokens.countTokens() == 8) {
int count = 0;
while (addressTokens.hasMoreTokens()) {
int word = Integer.parseInt(a... | java | public static InetAddress InetAddressByIPv6(String address) {
StringTokenizer addressTokens = new StringTokenizer(address, ":");
byte[] bytes = new byte[16];
if (addressTokens.countTokens() == 8) {
int count = 0;
while (addressTokens.hasMoreTokens()) {
int word = Integer.parseInt(a... | [
"public",
"static",
"InetAddress",
"InetAddressByIPv6",
"(",
"String",
"address",
")",
"{",
"StringTokenizer",
"addressTokens",
"=",
"new",
"StringTokenizer",
"(",
"address",
",",
"\":\"",
")",
";",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"16",
"... | Convert defined string to IPv6 object instance
@param address string representation of ip address
@return IPv6 object instance | [
"Convert",
"defined",
"string",
"to",
"IPv6",
"object",
"instance"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/IPConverter.java#L95-L115 | train |
RestComm/jdiameter | examples/guide1/src/main/java/org/example/client/ExampleClient.java | ExampleClient.initStack | private void initStack() {
if (log.isInfoEnabled()) {
log.info("Initializing Stack...");
}
InputStream is = null;
try {
//Parse dictionary, it is used for user friendly info.
dictionary.parseDictionary(this.getClass().getClassLoader().getResourceAsStream(dictionaryFile));
... | java | private void initStack() {
if (log.isInfoEnabled()) {
log.info("Initializing Stack...");
}
InputStream is = null;
try {
//Parse dictionary, it is used for user friendly info.
dictionary.parseDictionary(this.getClass().getClassLoader().getResourceAsStream(dictionaryFile));
... | [
"private",
"void",
"initStack",
"(",
")",
"{",
"if",
"(",
"log",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"log",
".",
"info",
"(",
"\"Initializing Stack...\"",
")",
";",
"}",
"InputStream",
"is",
"=",
"null",
";",
"try",
"{",
"//Parse dictionary, it is us... | boolean telling if we finished our interaction | [
"boolean",
"telling",
"if",
"we",
"finished",
"our",
"interaction"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/examples/guide1/src/main/java/org/example/client/ExampleClient.java#L119-L200 | train |
RestComm/jdiameter | examples/guide1/src/main/java/org/example/client/ExampleClient.java | ExampleClient.printAvpsAux | private void printAvpsAux(AvpSet avpSet, int level) throws AvpDataException {
String prefix = " ".substring(0, level * 2);
for (Avp avp : avpSet) {
AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(avp.getCode(), avp.getVendorId());
if (avpRep != null && avpRep.ge... | java | private void printAvpsAux(AvpSet avpSet, int level) throws AvpDataException {
String prefix = " ".substring(0, level * 2);
for (Avp avp : avpSet) {
AvpRepresentation avpRep = AvpDictionary.INSTANCE.getAvp(avp.getCode(), avp.getVendorId());
if (avpRep != null && avpRep.ge... | [
"private",
"void",
"printAvpsAux",
"(",
"AvpSet",
"avpSet",
",",
"int",
"level",
")",
"throws",
"AvpDataException",
"{",
"String",
"prefix",
"=",
"\" \"",
".",
"substring",
"(",
"0",
",",
"level",
"*",
"2",
")",
";",
"for",
"(",
"Avp",
... | Prints the AVPs present in an AvpSet with a specified 'tab' level
@param avpSet
the AvpSet containing the AVPs to be printed
@param level
an int representing the number of 'tabs' to make a pretty
print
@throws AvpDataException | [
"Prints",
"the",
"AVPs",
"present",
"in",
"an",
"AvpSet",
"with",
"a",
"specified",
"tab",
"level"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/examples/guide1/src/main/java/org/example/client/ExampleClient.java#L388-L417 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tls/netty/TLSTransportClient.java | TLSTransportClient.start | public void start() throws InterruptedException {
logger.debug("Staring client TLSTransportClient {} ", socketDescription);
if (isConnected()) {
logger.debug("Already connected TLSTransportClient {} ", socketDescription);
return;
}
workerGroup = new NioEventLoopGroup();
Bootstrap bootst... | java | public void start() throws InterruptedException {
logger.debug("Staring client TLSTransportClient {} ", socketDescription);
if (isConnected()) {
logger.debug("Already connected TLSTransportClient {} ", socketDescription);
return;
}
workerGroup = new NioEventLoopGroup();
Bootstrap bootst... | [
"public",
"void",
"start",
"(",
")",
"throws",
"InterruptedException",
"{",
"logger",
".",
"debug",
"(",
"\"Staring client TLSTransportClient {} \"",
",",
"socketDescription",
")",
";",
"if",
"(",
"isConnected",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
... | only client side | [
"only",
"client",
"side"
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/transport/tls/netty/TLSTransportClient.java#L110-L136 | train |
RestComm/jdiameter | core/jdiameter/api/src/main/java/org/jdiameter/api/StackManager.java | StackManager.getStacks | public static synchronized Enumeration<Stack> getStacks() {
List<Stack> result = new CopyOnWriteArrayList<Stack>();
if (!initialized) {
initialize();
}
// Gets the classloader of the code that called this method, may be null.
ClassLoader callerCL = ClassLoader.getSystemClassLoader();
... | java | public static synchronized Enumeration<Stack> getStacks() {
List<Stack> result = new CopyOnWriteArrayList<Stack>();
if (!initialized) {
initialize();
}
// Gets the classloader of the code that called this method, may be null.
ClassLoader callerCL = ClassLoader.getSystemClassLoader();
... | [
"public",
"static",
"synchronized",
"Enumeration",
"<",
"Stack",
">",
"getStacks",
"(",
")",
"{",
"List",
"<",
"Stack",
">",
"result",
"=",
"new",
"CopyOnWriteArrayList",
"<",
"Stack",
">",
"(",
")",
";",
"if",
"(",
"!",
"initialized",
")",
"{",
"initial... | Retrieves an Enumeration with all of the currently loaded Diameter stacks
to which the current caller has access.
<P><B>Note:</B> The classname of a stack can be found using
<CODE>d.getClass().getName()</CODE>
@return the list of Diameter stacks loaded by the caller's class loader | [
"Retrieves",
"an",
"Enumeration",
"with",
"all",
"of",
"the",
"currently",
"loaded",
"Diameter",
"stacks",
"to",
"which",
"the",
"current",
"caller",
"has",
"access",
"."
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/api/src/main/java/org/jdiameter/api/StackManager.java#L235-L253 | train |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/MessageUtility.java | MessageUtility.addOriginAvps | public static void addOriginAvps(Message m, MetaData md) {
// FIXME: check for "userFqnAsUri" ?
AvpSet set = m.getAvps();
if (set.getAvp(Avp.ORIGIN_HOST) == null) {
m.getAvps().addAvp(Avp.ORIGIN_HOST, md.getLocalPeer().getUri().getFQDN(), true, false, true);
}
if (set.getAvp(Avp.ORIGIN_REALM) ... | java | public static void addOriginAvps(Message m, MetaData md) {
// FIXME: check for "userFqnAsUri" ?
AvpSet set = m.getAvps();
if (set.getAvp(Avp.ORIGIN_HOST) == null) {
m.getAvps().addAvp(Avp.ORIGIN_HOST, md.getLocalPeer().getUri().getFQDN(), true, false, true);
}
if (set.getAvp(Avp.ORIGIN_REALM) ... | [
"public",
"static",
"void",
"addOriginAvps",
"(",
"Message",
"m",
",",
"MetaData",
"md",
")",
"{",
"// FIXME: check for \"userFqnAsUri\" ?",
"AvpSet",
"set",
"=",
"m",
".",
"getAvps",
"(",
")",
";",
"if",
"(",
"set",
".",
"getAvp",
"(",
"Avp",
".",
"ORIGIN... | Used to set origin, previously done in MessageParser.
@param m
@param md | [
"Used",
"to",
"set",
"origin",
"previously",
"done",
"in",
"MessageParser",
"."
] | 672134c378ea9704bf06dbe1985872ad4ebf4640 | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/MessageUtility.java#L66-L75 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/core/query/RiakObject.java | RiakObject.setVTag | public RiakObject setVTag(String vtag)
{
if (vtag != null && vtag.isEmpty())
{
throw new IllegalArgumentException("vtag can not be zero length");
}
this.vtag = vtag;
return this;
} | java | public RiakObject setVTag(String vtag)
{
if (vtag != null && vtag.isEmpty())
{
throw new IllegalArgumentException("vtag can not be zero length");
}
this.vtag = vtag;
return this;
} | [
"public",
"RiakObject",
"setVTag",
"(",
"String",
"vtag",
")",
"{",
"if",
"(",
"vtag",
"!=",
"null",
"&&",
"vtag",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"vtag can not be zero length\"",
")",
";",
"}",
"this",
... | Set the version tag for this RiakObject
@param vtag a {@code String} representing the VTag for this RiakObject
@return a reference to this object
@throws IllegalArgumentException if {@code vtag} is zero length | [
"Set",
"the",
"version",
"tag",
"for",
"this",
"RiakObject"
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/RiakObject.java#L179-L187 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/core/RiakCluster.java | RiakCluster.removeNode | public boolean removeNode(RiakNode node)
{
stateCheck(State.CREATED, State.RUNNING, State.QUEUING);
boolean removed = false;
try
{
nodeListLock.writeLock().lock();
removed = nodeList.remove(node);
for (NodeStateListener listener : stateListeners)
... | java | public boolean removeNode(RiakNode node)
{
stateCheck(State.CREATED, State.RUNNING, State.QUEUING);
boolean removed = false;
try
{
nodeListLock.writeLock().lock();
removed = nodeList.remove(node);
for (NodeStateListener listener : stateListeners)
... | [
"public",
"boolean",
"removeNode",
"(",
"RiakNode",
"node",
")",
"{",
"stateCheck",
"(",
"State",
".",
"CREATED",
",",
"State",
".",
"RUNNING",
",",
"State",
".",
"QUEUING",
")",
";",
"boolean",
"removed",
"=",
"false",
";",
"try",
"{",
"nodeListLock",
"... | Removes the provided node from the cluster.
@param node
@return true if the node was in the cluster, false otherwise. | [
"Removes",
"the",
"provided",
"node",
"from",
"the",
"cluster",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakCluster.java#L381-L400 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/core/RiakCluster.java | RiakCluster.getNodes | public List<RiakNode> getNodes()
{
stateCheck(State.CREATED, State.RUNNING, State.SHUTTING_DOWN, State.QUEUING);
try
{
nodeListLock.readLock().lock();
return new ArrayList<>(nodeList);
}
finally
{
nodeListLock.readLock().unlock();
... | java | public List<RiakNode> getNodes()
{
stateCheck(State.CREATED, State.RUNNING, State.SHUTTING_DOWN, State.QUEUING);
try
{
nodeListLock.readLock().lock();
return new ArrayList<>(nodeList);
}
finally
{
nodeListLock.readLock().unlock();
... | [
"public",
"List",
"<",
"RiakNode",
">",
"getNodes",
"(",
")",
"{",
"stateCheck",
"(",
"State",
".",
"CREATED",
",",
"State",
".",
"RUNNING",
",",
"State",
".",
"SHUTTING_DOWN",
",",
"State",
".",
"QUEUING",
")",
";",
"try",
"{",
"nodeListLock",
".",
"r... | Returns a copy of the list of nodes in this cluster.
@return A copy of the list of RiakNodes | [
"Returns",
"a",
"copy",
"of",
"the",
"list",
"of",
"nodes",
"in",
"this",
"cluster",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakCluster.java#L406-L418 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/convert/RiakBeanSerializerModifier.java | RiakBeanSerializerModifier.keepProperty | private boolean keepProperty(BeanPropertyWriter beanPropertyWriter)
{
if (beanPropertyWriter.getAnnotation(JsonProperty.class) != null)
{
return true;
}
for (Class<? extends Annotation> annotation : RIAK_ANNOTATIONS)
{
if (beanPropertyWriter.getAnnotat... | java | private boolean keepProperty(BeanPropertyWriter beanPropertyWriter)
{
if (beanPropertyWriter.getAnnotation(JsonProperty.class) != null)
{
return true;
}
for (Class<? extends Annotation> annotation : RIAK_ANNOTATIONS)
{
if (beanPropertyWriter.getAnnotat... | [
"private",
"boolean",
"keepProperty",
"(",
"BeanPropertyWriter",
"beanPropertyWriter",
")",
"{",
"if",
"(",
"beanPropertyWriter",
".",
"getAnnotation",
"(",
"JsonProperty",
".",
"class",
")",
"!=",
"null",
")",
"{",
"return",
"true",
";",
"}",
"for",
"(",
"Cla... | Checks if the property has any of the Riak annotations on it or the
Jackson JsonProperty annotation.
If a Riak annotation is present without the Jackson JsonProperty
annotation, this will return false.
If a property has been annotated with both the Jackson JsonProperty
annotation and a Riak annotation, the Jackson an... | [
"Checks",
"if",
"the",
"property",
"has",
"any",
"of",
"the",
"Riak",
"annotations",
"on",
"it",
"or",
"the",
"Jackson",
"JsonProperty",
"annotation",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/convert/RiakBeanSerializerModifier.java#L119-L133 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/RiakClient.java | RiakClient.newClient | public static RiakClient newClient(InetSocketAddress... addresses) throws UnknownHostException
{
final List<String> remoteAddresses = new ArrayList<>(addresses.length);
for (InetSocketAddress addy : addresses)
{
remoteAddresses.add(
String.format("%s:%s", add... | java | public static RiakClient newClient(InetSocketAddress... addresses) throws UnknownHostException
{
final List<String> remoteAddresses = new ArrayList<>(addresses.length);
for (InetSocketAddress addy : addresses)
{
remoteAddresses.add(
String.format("%s:%s", add... | [
"public",
"static",
"RiakClient",
"newClient",
"(",
"InetSocketAddress",
"...",
"addresses",
")",
"throws",
"UnknownHostException",
"{",
"final",
"List",
"<",
"String",
">",
"remoteAddresses",
"=",
"new",
"ArrayList",
"<>",
"(",
"addresses",
".",
"length",
")",
... | Static factory method to create a new client instance.
This method produces a client connected to the supplied addresses.
@param addresses one or more addresses to connect to.
@return a new RiakClient instance.
@throws java.net.UnknownHostException if a supplied hostname cannot be resolved. | [
"Static",
"factory",
"method",
"to",
"create",
"a",
"new",
"client",
"instance",
".",
"This",
"method",
"produces",
"a",
"client",
"connected",
"to",
"the",
"supplied",
"addresses",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/RiakClient.java#L259-L271 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/core/query/functions/Function.java | Function.newStoredJsFunction | public static Function newStoredJsFunction(String bucket, String key)
{
return new Builder().withBucket(bucket).withKey(key).build();
} | java | public static Function newStoredJsFunction(String bucket, String key)
{
return new Builder().withBucket(bucket).withKey(key).build();
} | [
"public",
"static",
"Function",
"newStoredJsFunction",
"(",
"String",
"bucket",
",",
"String",
"key",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"withBucket",
"(",
"bucket",
")",
".",
"withKey",
"(",
"key",
")",
".",
"build",
"(",
")",
";",
"... | Static factory method for Stored Javascript Functions.
@param bucket The bucket where the JS function is stored
@param key the key for the object containing the JS function
@return a Function representing a stored JS function. | [
"Static",
"factory",
"method",
"for",
"Stored",
"Javascript",
"Functions",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/functions/Function.java#L167-L170 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/core/query/functions/Function.java | Function.newErlangFunction | public static Function newErlangFunction(String module, String function)
{
return new Builder().withModule(module).withFunction(function).build();
} | java | public static Function newErlangFunction(String module, String function)
{
return new Builder().withModule(module).withFunction(function).build();
} | [
"public",
"static",
"Function",
"newErlangFunction",
"(",
"String",
"module",
",",
"String",
"function",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"withModule",
"(",
"module",
")",
".",
"withFunction",
"(",
"function",
")",
".",
"build",
"(",
")... | Static factory method for Erlang Functions.
@param module the module that contains the Erlang function.
@param function the name of the erlang function.
@return a Function representing a Erlang function. | [
"Static",
"factory",
"method",
"for",
"Erlang",
"Functions",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/functions/Function.java#L188-L191 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/core/query/timeseries/Row.java | Row.getCellsCopy | public List<Cell> getCellsCopy()
{
final ArrayList<Cell> cells = new ArrayList<>(this.getCellsCount());
for (Cell c: this)
{
cells.add(c);
}
return cells;
} | java | public List<Cell> getCellsCopy()
{
final ArrayList<Cell> cells = new ArrayList<>(this.getCellsCount());
for (Cell c: this)
{
cells.add(c);
}
return cells;
} | [
"public",
"List",
"<",
"Cell",
">",
"getCellsCopy",
"(",
")",
"{",
"final",
"ArrayList",
"<",
"Cell",
">",
"cells",
"=",
"new",
"ArrayList",
"<>",
"(",
"this",
".",
"getCellsCount",
"(",
")",
")",
";",
"for",
"(",
"Cell",
"c",
":",
"this",
")",
"{"... | Get a shallow copy of the cells in this row.
@return a List<Cell> shallow copy of the cells in this row. | [
"Get",
"a",
"shallow",
"copy",
"of",
"the",
"cells",
"in",
"this",
"row",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/timeseries/Row.java#L73-L82 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/core/query/timeseries/Row.java | Row.iterator | @Override
public Iterator<Cell> iterator()
{
if (cells != null)
{
return cells.iterator();
}
else // if (pbRow != null)
{
assert pbRow != null;
return ConvertibleIteratorUtils.iterateAsCell(pbRow.getCellsList().iterator(),
... | java | @Override
public Iterator<Cell> iterator()
{
if (cells != null)
{
return cells.iterator();
}
else // if (pbRow != null)
{
assert pbRow != null;
return ConvertibleIteratorUtils.iterateAsCell(pbRow.getCellsList().iterator(),
... | [
"@",
"Override",
"public",
"Iterator",
"<",
"Cell",
">",
"iterator",
"(",
")",
"{",
"if",
"(",
"cells",
"!=",
"null",
")",
"{",
"return",
"cells",
".",
"iterator",
"(",
")",
";",
"}",
"else",
"// if (pbRow != null)",
"{",
"assert",
"pbRow",
"!=",
"null... | An iterator of the Cells in this row.
@return an iterator. | [
"An",
"iterator",
"of",
"the",
"Cells",
"in",
"this",
"row",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/timeseries/Row.java#L100-L115 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/core/util/DefaultCharset.java | DefaultCharset.set | public static void set(Charset charset)
{
final Charset current = instance.currentCharset.get();
logger.info("Setting client charset from '{}' to '{}'", current.name(), charset.name());
instance.currentCharset.set(charset);
} | java | public static void set(Charset charset)
{
final Charset current = instance.currentCharset.get();
logger.info("Setting client charset from '{}' to '{}'", current.name(), charset.name());
instance.currentCharset.set(charset);
} | [
"public",
"static",
"void",
"set",
"(",
"Charset",
"charset",
")",
"{",
"final",
"Charset",
"current",
"=",
"instance",
".",
"currentCharset",
".",
"get",
"(",
")",
";",
"logger",
".",
"info",
"(",
"\"Setting client charset from '{}' to '{}'\"",
",",
"current",
... | Set the classloader-wide default Charset for the Riak client.
@param charset The charset to set the classloader-wide default to. | [
"Set",
"the",
"classloader",
"-",
"wide",
"default",
"Charset",
"for",
"the",
"Riak",
"client",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/util/DefaultCharset.java#L109-L114 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/commands/datatypes/MapUpdate.java | MapUpdate.removeCounter | public MapUpdate removeCounter(String key)
{
BinaryValue k = BinaryValue.create(key);
removes.add(new MapOp.MapField(MapOp.FieldType.COUNTER, k));
return this;
} | java | public MapUpdate removeCounter(String key)
{
BinaryValue k = BinaryValue.create(key);
removes.add(new MapOp.MapField(MapOp.FieldType.COUNTER, k));
return this;
} | [
"public",
"MapUpdate",
"removeCounter",
"(",
"String",
"key",
")",
"{",
"BinaryValue",
"k",
"=",
"BinaryValue",
".",
"create",
"(",
"key",
")",
";",
"removes",
".",
"add",
"(",
"new",
"MapOp",
".",
"MapField",
"(",
"MapOp",
".",
"FieldType",
".",
"COUNTE... | Update the map in Riak by removing the counter mapped to the provided key.
@param key the key the counter is mapped to.
@return a reference to this object. | [
"Update",
"the",
"map",
"in",
"Riak",
"by",
"removing",
"the",
"counter",
"mapped",
"to",
"the",
"provided",
"key",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/commands/datatypes/MapUpdate.java#L52-L57 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/commands/datatypes/MapUpdate.java | MapUpdate.removeRegister | public MapUpdate removeRegister(String key)
{
BinaryValue k = BinaryValue.create(key);
removes.add(new MapOp.MapField(MapOp.FieldType.REGISTER, k));
return this;
} | java | public MapUpdate removeRegister(String key)
{
BinaryValue k = BinaryValue.create(key);
removes.add(new MapOp.MapField(MapOp.FieldType.REGISTER, k));
return this;
} | [
"public",
"MapUpdate",
"removeRegister",
"(",
"String",
"key",
")",
"{",
"BinaryValue",
"k",
"=",
"BinaryValue",
".",
"create",
"(",
"key",
")",
";",
"removes",
".",
"add",
"(",
"new",
"MapOp",
".",
"MapField",
"(",
"MapOp",
".",
"FieldType",
".",
"REGIS... | Update the map in Riak by removing the register mapped to the provided key.
@param key the key the register is mapped to.
@return a reference to this object. | [
"Update",
"the",
"map",
"in",
"Riak",
"by",
"removing",
"the",
"register",
"mapped",
"to",
"the",
"provided",
"key",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/commands/datatypes/MapUpdate.java#L64-L69 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/commands/datatypes/MapUpdate.java | MapUpdate.removeFlag | public MapUpdate removeFlag(String key)
{
BinaryValue k = BinaryValue.create(key);
removes.add(new MapOp.MapField(MapOp.FieldType.FLAG, k));
return this;
} | java | public MapUpdate removeFlag(String key)
{
BinaryValue k = BinaryValue.create(key);
removes.add(new MapOp.MapField(MapOp.FieldType.FLAG, k));
return this;
} | [
"public",
"MapUpdate",
"removeFlag",
"(",
"String",
"key",
")",
"{",
"BinaryValue",
"k",
"=",
"BinaryValue",
".",
"create",
"(",
"key",
")",
";",
"removes",
".",
"add",
"(",
"new",
"MapOp",
".",
"MapField",
"(",
"MapOp",
".",
"FieldType",
".",
"FLAG",
... | Update the map in Riak by removing the flag mapped to the provided key.
@param key the key the flag is mapped to.
@return a reference to this object. | [
"Update",
"the",
"map",
"in",
"Riak",
"by",
"removing",
"the",
"flag",
"mapped",
"to",
"the",
"provided",
"key",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/commands/datatypes/MapUpdate.java#L76-L81 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/commands/datatypes/MapUpdate.java | MapUpdate.removeSet | public MapUpdate removeSet(String key)
{
BinaryValue k = BinaryValue.create(key);
removes.add(new MapOp.MapField(MapOp.FieldType.SET, k));
return this;
} | java | public MapUpdate removeSet(String key)
{
BinaryValue k = BinaryValue.create(key);
removes.add(new MapOp.MapField(MapOp.FieldType.SET, k));
return this;
} | [
"public",
"MapUpdate",
"removeSet",
"(",
"String",
"key",
")",
"{",
"BinaryValue",
"k",
"=",
"BinaryValue",
".",
"create",
"(",
"key",
")",
";",
"removes",
".",
"add",
"(",
"new",
"MapOp",
".",
"MapField",
"(",
"MapOp",
".",
"FieldType",
".",
"SET",
",... | Update the map in Riak by removing the set mapped to the provided key.
@param key the key the set is mapped to.
@return a reference to this object. | [
"Update",
"the",
"map",
"in",
"Riak",
"by",
"removing",
"the",
"set",
"mapped",
"to",
"the",
"provided",
"key",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/commands/datatypes/MapUpdate.java#L88-L93 | train |
basho/riak-java-client | src/main/java/com/basho/riak/client/api/commands/datatypes/MapUpdate.java | MapUpdate.removeMap | public MapUpdate removeMap(String key)
{
BinaryValue k = BinaryValue.create(key);
removes.add(new MapOp.MapField(MapOp.FieldType.MAP, k));
return this;
} | java | public MapUpdate removeMap(String key)
{
BinaryValue k = BinaryValue.create(key);
removes.add(new MapOp.MapField(MapOp.FieldType.MAP, k));
return this;
} | [
"public",
"MapUpdate",
"removeMap",
"(",
"String",
"key",
")",
"{",
"BinaryValue",
"k",
"=",
"BinaryValue",
".",
"create",
"(",
"key",
")",
";",
"removes",
".",
"add",
"(",
"new",
"MapOp",
".",
"MapField",
"(",
"MapOp",
".",
"FieldType",
".",
"MAP",
",... | Update the map in Riak by removing the map mapped to the provided key.
@param key the key the map is mapped to.
@return a reference to this object. | [
"Update",
"the",
"map",
"in",
"Riak",
"by",
"removing",
"the",
"map",
"mapped",
"to",
"the",
"provided",
"key",
"."
] | bed6cd60f360bacf1b873ab92dd74f2526651e71 | https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/api/commands/datatypes/MapUpdate.java#L100-L105 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.