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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java | SpiderSession.copyObjectIDsToBatch | private void copyObjectIDsToBatch(BatchResult batchResult, DBObjectBatch dbObjBatch) {
if (batchResult.getResultObjectCount() < dbObjBatch.getObjectCount()) {
m_logger.warn("Batch result returned fewer objects ({}) than input batch ({})",
batchResult.getResultObjectCount... | java | private void copyObjectIDsToBatch(BatchResult batchResult, DBObjectBatch dbObjBatch) {
if (batchResult.getResultObjectCount() < dbObjBatch.getObjectCount()) {
m_logger.warn("Batch result returned fewer objects ({}) than input batch ({})",
batchResult.getResultObjectCount... | [
"private",
"void",
"copyObjectIDsToBatch",
"(",
"BatchResult",
"batchResult",
",",
"DBObjectBatch",
"dbObjBatch",
")",
"{",
"if",
"(",
"batchResult",
".",
"getResultObjectCount",
"(",
")",
"<",
"dbObjBatch",
".",
"getObjectCount",
"(",
")",
")",
"{",
"m_logger",
... | within the given DBObjectBatch. | [
"within",
"the",
"given",
"DBObjectBatch",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java#L552-L574 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java | SpiderSession.verifyApplication | private void verifyApplication() {
String ss = m_appDef.getStorageService();
if (Utils.isEmpty(ss) || !ss.startsWith("Spider")) {
throw new RuntimeException("Application '" + m_appDef.getAppName() +
"' is not an Spider application");
}
... | java | private void verifyApplication() {
String ss = m_appDef.getStorageService();
if (Utils.isEmpty(ss) || !ss.startsWith("Spider")) {
throw new RuntimeException("Application '" + m_appDef.getAppName() +
"' is not an Spider application");
}
... | [
"private",
"void",
"verifyApplication",
"(",
")",
"{",
"String",
"ss",
"=",
"m_appDef",
".",
"getStorageService",
"(",
")",
";",
"if",
"(",
"Utils",
".",
"isEmpty",
"(",
"ss",
")",
"||",
"!",
"ss",
".",
"startsWith",
"(",
"\"Spider\"",
")",
")",
"{",
... | Throw if this session's AppDef is not for a Spider app. | [
"Throw",
"if",
"this",
"session",
"s",
"AppDef",
"is",
"not",
"for",
"a",
"Spider",
"app",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/SpiderSession.java#L577-L583 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/mbeans/CassandraNode.java | CassandraNode.getVersionNumber | double getVersionNumber() {
if(cassandraVersion > 0) {
return cassandraVersion;
}
String version = getReleaseVersion();
if (version == null) {
throw new IllegalStateException("Can't get Cassandra release version.");
}
String[] toks = version.split("\\.");
if (toks.length >= 3) {... | java | double getVersionNumber() {
if(cassandraVersion > 0) {
return cassandraVersion;
}
String version = getReleaseVersion();
if (version == null) {
throw new IllegalStateException("Can't get Cassandra release version.");
}
String[] toks = version.split("\\.");
if (toks.length >= 3) {... | [
"double",
"getVersionNumber",
"(",
")",
"{",
"if",
"(",
"cassandraVersion",
">",
"0",
")",
"{",
"return",
"cassandraVersion",
";",
"}",
"String",
"version",
"=",
"getReleaseVersion",
"(",
")",
";",
"if",
"(",
"version",
"==",
"null",
")",
"{",
"throw",
"... | 12.23.345bla-bla => 012023.345 | [
"12",
".",
"23",
".",
"345bla",
"-",
"bla",
"=",
">",
"012023",
".",
"345"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/mbeans/CassandraNode.java#L234-L288 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/mbeans/CassandraNode.java | CassandraNode.getDataMap_1_1 | private Map<File, File[]> getDataMap_1_1(String[] dataDirs) {
Map<File, File[]> map = new HashMap<File, File[]>();
boolean doLog = false;
if(!lockedMessages.contains("getDataMap")) {
lockedMessages.add("getDataMap");
doLog = true;
}
for (int i = 0; i < dataDirs.length; i++) {
File dir = n... | java | private Map<File, File[]> getDataMap_1_1(String[] dataDirs) {
Map<File, File[]> map = new HashMap<File, File[]>();
boolean doLog = false;
if(!lockedMessages.contains("getDataMap")) {
lockedMessages.add("getDataMap");
doLog = true;
}
for (int i = 0; i < dataDirs.length; i++) {
File dir = n... | [
"private",
"Map",
"<",
"File",
",",
"File",
"[",
"]",
">",
"getDataMap_1_1",
"(",
"String",
"[",
"]",
"dataDirs",
")",
"{",
"Map",
"<",
"File",
",",
"File",
"[",
"]",
">",
"map",
"=",
"new",
"HashMap",
"<",
"File",
",",
"File",
"[",
"]",
">",
"... | family-dir -> snapshot-dir-list | [
"family",
"-",
"dir",
"-",
">",
"snapshot",
"-",
"dir",
"-",
"list"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/mbeans/CassandraNode.java#L1052-L1115 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/mbeans/CassandraNode.java | CassandraNode.getDataMap | private Map<File, File> getDataMap(int vcode, String[] dataDirs, String snapshotName) {
Map<File, File> map = new HashMap<File, File>();
Map<File, File[]> src = vcode==0 ? getDataMap_1_0(dataDirs) : getDataMap_1_1(dataDirs);
for (File ks : src.keySet()) {
File[] sn = src.get(ks);
if (sn != null) {
... | java | private Map<File, File> getDataMap(int vcode, String[] dataDirs, String snapshotName) {
Map<File, File> map = new HashMap<File, File>();
Map<File, File[]> src = vcode==0 ? getDataMap_1_0(dataDirs) : getDataMap_1_1(dataDirs);
for (File ks : src.keySet()) {
File[] sn = src.get(ks);
if (sn != null) {
... | [
"private",
"Map",
"<",
"File",
",",
"File",
">",
"getDataMap",
"(",
"int",
"vcode",
",",
"String",
"[",
"]",
"dataDirs",
",",
"String",
"snapshotName",
")",
"{",
"Map",
"<",
"File",
",",
"File",
">",
"map",
"=",
"new",
"HashMap",
"<",
"File",
",",
... | keyspace-dir -> snapshot-dir | [
"keyspace",
"-",
"dir",
"-",
">",
"snapshot",
"-",
"dir"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/mbeans/CassandraNode.java#L1118-L1136 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/utils/HelloDory.java | HelloDory.run | private void run(String[] args) {
if (args.length != 2) {
usage();
}
System.out.println("Opening Doradus server: " + args[0] + ":" + args[1]);
try (DoradusClient client = new DoradusClient(args[0], Integer.parseInt(args[1]))) {
deleteApplication(cl... | java | private void run(String[] args) {
if (args.length != 2) {
usage();
}
System.out.println("Opening Doradus server: " + args[0] + ":" + args[1]);
try (DoradusClient client = new DoradusClient(args[0], Integer.parseInt(args[1]))) {
deleteApplication(cl... | [
"private",
"void",
"run",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"args",
".",
"length",
"!=",
"2",
")",
"{",
"usage",
"(",
")",
";",
"}",
"System",
".",
"out",
".",
"println",
"(",
"\"Opening Doradus server: \"",
"+",
"args",
"[",
"0... | Create a Dory client connection and execute the example commands. | [
"Create",
"a",
"Dory",
"client",
"connection",
"and",
"execute",
"the",
"example",
"commands",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/utils/HelloDory.java#L84-L97 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/utils/HelloDory.java | HelloDory.deleteApplication | private void deleteApplication(DoradusClient client) {
Command command = Command.builder()
.withName("DeleteAppWithKey")
.withParam("application", "HelloSpider")
.withParam("key", "Arachnid")
.build();
client.runCommand(command); // Ignore response
... | java | private void deleteApplication(DoradusClient client) {
Command command = Command.builder()
.withName("DeleteAppWithKey")
.withParam("application", "HelloSpider")
.withParam("key", "Arachnid")
.build();
client.runCommand(command); // Ignore response
... | [
"private",
"void",
"deleteApplication",
"(",
"DoradusClient",
"client",
")",
"{",
"Command",
"command",
"=",
"Command",
".",
"builder",
"(",
")",
".",
"withName",
"(",
"\"DeleteAppWithKey\"",
")",
".",
"withParam",
"(",
"\"application\"",
",",
"\"HelloSpider\"",
... | Delete the existing HelloSpider application if present. | [
"Delete",
"the",
"existing",
"HelloSpider",
"application",
"if",
"present",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/utils/HelloDory.java#L102-L109 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/utils/HelloDory.java | HelloDory.createApplication | private void createApplication(DoradusClient client) {
ApplicationDefinition appDef = ApplicationDefinition.builder()
.withName("HelloSpider")
.withKey("Arachnid")
.withOption("StorageService", "SpiderService")
.withTable(TableDefinition.builder()
... | java | private void createApplication(DoradusClient client) {
ApplicationDefinition appDef = ApplicationDefinition.builder()
.withName("HelloSpider")
.withKey("Arachnid")
.withOption("StorageService", "SpiderService")
.withTable(TableDefinition.builder()
... | [
"private",
"void",
"createApplication",
"(",
"DoradusClient",
"client",
")",
"{",
"ApplicationDefinition",
"appDef",
"=",
"ApplicationDefinition",
".",
"builder",
"(",
")",
".",
"withName",
"(",
"\"HelloSpider\"",
")",
".",
"withKey",
"(",
"\"Arachnid\"",
")",
"."... | Create the HelloSpider application definition. | [
"Create",
"the",
"HelloSpider",
"application",
"definition",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/utils/HelloDory.java#L112-L142 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/utils/HelloDory.java | HelloDory.deleteData | private void deleteData(DoradusClient client) {
DBObject dbObject = DBObject.builder()
.withValue("_ID", "TMaguire")
.build();
DBObjectBatch dbObjectBatch = DBObjectBatch.builder().withObject(dbObject).build();
Command command = Command.builder().withName("Delet... | java | private void deleteData(DoradusClient client) {
DBObject dbObject = DBObject.builder()
.withValue("_ID", "TMaguire")
.build();
DBObjectBatch dbObjectBatch = DBObjectBatch.builder().withObject(dbObject).build();
Command command = Command.builder().withName("Delet... | [
"private",
"void",
"deleteData",
"(",
"DoradusClient",
"client",
")",
"{",
"DBObject",
"dbObject",
"=",
"DBObject",
".",
"builder",
"(",
")",
".",
"withValue",
"(",
"\"_ID\"",
",",
"\"TMaguire\"",
")",
".",
"build",
"(",
")",
";",
"DBObjectBatch",
"dbObjectB... | Delete data by ID | [
"Delete",
"data",
"by",
"ID"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/utils/HelloDory.java#L267-L281 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/utils/CSVDumper.java | CSVDumper.loadSchema | private void loadSchema() {
m_logger.info("Loading schema for application: {}", m_config.app);
m_client = new Client(m_config.host, m_config.port, m_config.getTLSParams());
m_client.setCredentials(m_config.getCredentials());
m_session = m_client.openApplication(m_config.app); // thro... | java | private void loadSchema() {
m_logger.info("Loading schema for application: {}", m_config.app);
m_client = new Client(m_config.host, m_config.port, m_config.getTLSParams());
m_client.setCredentials(m_config.getCredentials());
m_session = m_client.openApplication(m_config.app); // thro... | [
"private",
"void",
"loadSchema",
"(",
")",
"{",
"m_logger",
".",
"info",
"(",
"\"Loading schema for application: {}\"",
",",
"m_config",
".",
"app",
")",
";",
"m_client",
"=",
"new",
"Client",
"(",
"m_config",
".",
"host",
",",
"m_config",
".",
"port",
",",
... | Connect to the Doradus server and download the requested application's schema. | [
"Connect",
"to",
"the",
"Doradus",
"server",
"and",
"download",
"the",
"requested",
"application",
"s",
"schema",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/utils/CSVDumper.java#L247-L256 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/utils/CSVDumper.java | CSVDumper.computeLinkFanouts | private void computeLinkFanouts(TableDefinition tableDef,
Map<String, MutableFloat> tableLinkFanoutMap) {
m_logger.info("Computing link field fanouts for table: {}", tableDef.getTableName());
StringBuilder buffer = new StringBuilder();
for (Field... | java | private void computeLinkFanouts(TableDefinition tableDef,
Map<String, MutableFloat> tableLinkFanoutMap) {
m_logger.info("Computing link field fanouts for table: {}", tableDef.getTableName());
StringBuilder buffer = new StringBuilder();
for (Field... | [
"private",
"void",
"computeLinkFanouts",
"(",
"TableDefinition",
"tableDef",
",",
"Map",
"<",
"String",
",",
"MutableFloat",
">",
"tableLinkFanoutMap",
")",
"{",
"m_logger",
".",
"info",
"(",
"\"Computing link field fanouts for table: {}\"",
",",
"tableDef",
".",
"get... | Compute link fanouts for the given table | [
"Compute",
"link",
"fanouts",
"for",
"the",
"given",
"table"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/utils/CSVDumper.java#L358-L410 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/utilities/TimerGroup.java | TimerGroup.start | private void start(long time, String name){
name = getName(name);
TimerGroupItem timer = m_timers.get(name);
if (timer == null){
timer = new TimerGroupItem(name);
m_timers.put(name, timer);
}
timer.start(time);
m_total.start(time);
} | java | private void start(long time, String name){
name = getName(name);
TimerGroupItem timer = m_timers.get(name);
if (timer == null){
timer = new TimerGroupItem(name);
m_timers.put(name, timer);
}
timer.start(time);
m_total.start(time);
} | [
"private",
"void",
"start",
"(",
"long",
"time",
",",
"String",
"name",
")",
"{",
"name",
"=",
"getName",
"(",
"name",
")",
";",
"TimerGroupItem",
"timer",
"=",
"m_timers",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"timer",
"==",
"null",
")",
"... | Start the named timer if the condition is true. | [
"Start",
"the",
"named",
"timer",
"if",
"the",
"condition",
"is",
"true",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/utilities/TimerGroup.java#L153-L162 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/utilities/TimerGroup.java | TimerGroup.stop | private long stop(long time, String name){
m_total.stop(time);
TimerGroupItem timer = m_timers.get(getName(name));
long elapsedTime = 0;
if (timer != null){
elapsedTime = timer.stop(time);
}
checkLog(time);
return elapsedTime;
} | java | private long stop(long time, String name){
m_total.stop(time);
TimerGroupItem timer = m_timers.get(getName(name));
long elapsedTime = 0;
if (timer != null){
elapsedTime = timer.stop(time);
}
checkLog(time);
return elapsedTime;
} | [
"private",
"long",
"stop",
"(",
"long",
"time",
",",
"String",
"name",
")",
"{",
"m_total",
".",
"stop",
"(",
"time",
")",
";",
"TimerGroupItem",
"timer",
"=",
"m_timers",
".",
"get",
"(",
"getName",
"(",
"name",
")",
")",
";",
"long",
"elapsedTime",
... | Stop the named timer if the condition is true. | [
"Stop",
"the",
"named",
"timer",
"if",
"the",
"condition",
"is",
"true",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/utilities/TimerGroup.java#L174-L183 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/utilities/TimerGroup.java | TimerGroup.log | private void log(boolean finalLog, String format, Object... args) {
if (m_condition){
if (format != null ){
m_logger.debug(String.format(format, args));
}
ArrayList<String> timerNames = new ArrayList<String>(m_timers.keySet());
Collections.sort(timerNames);
for (String name : timerNames){
... | java | private void log(boolean finalLog, String format, Object... args) {
if (m_condition){
if (format != null ){
m_logger.debug(String.format(format, args));
}
ArrayList<String> timerNames = new ArrayList<String>(m_timers.keySet());
Collections.sort(timerNames);
for (String name : timerNames){
... | [
"private",
"void",
"log",
"(",
"boolean",
"finalLog",
",",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"m_condition",
")",
"{",
"if",
"(",
"format",
"!=",
"null",
")",
"{",
"m_logger",
".",
"debug",
"(",
"String",
".",
"for... | Log elapsed time of all named timers if the condition is true. | [
"Log",
"elapsed",
"time",
"of",
"all",
"named",
"timers",
"if",
"the",
"condition",
"is",
"true",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/utilities/TimerGroup.java#L199-L223 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/DBObjectBatch.java | DBObjectBatch.parse | public void parse(UNode rootNode) {
assert rootNode != null;
// Ensure root node is named "batch".
Utils.require(rootNode.getName().equals("batch"),
"'batch' expected: " + rootNode.getName());
// Parse child nodes.
for (String memberName : ... | java | public void parse(UNode rootNode) {
assert rootNode != null;
// Ensure root node is named "batch".
Utils.require(rootNode.getName().equals("batch"),
"'batch' expected: " + rootNode.getName());
// Parse child nodes.
for (String memberName : ... | [
"public",
"void",
"parse",
"(",
"UNode",
"rootNode",
")",
"{",
"assert",
"rootNode",
"!=",
"null",
";",
"// Ensure root node is named \"batch\".\r",
"Utils",
".",
"require",
"(",
"rootNode",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"\"batch\"",
")",
",",
... | Parse a batch object update rooted at the given UNode. The root node must be a MAP
named "batch". Child nodes must be a recognized option or a "docs" array containing
"doc" objects. An exception is thrown if the batch is malformed.
@param rootNode Root node of a UNode tree defined an object update batch. | [
"Parse",
"a",
"batch",
"object",
"update",
"rooted",
"at",
"the",
"given",
"UNode",
".",
"The",
"root",
"node",
"must",
"be",
"a",
"MAP",
"named",
"batch",
".",
"Child",
"nodes",
"must",
"be",
"a",
"recognized",
"option",
"or",
"a",
"docs",
"array",
"c... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/DBObjectBatch.java#L221-L242 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/DBObjectBatch.java | DBObjectBatch.toDoc | public UNode toDoc() {
// Root object is a MAP called "batch".
UNode batchNode = UNode.createMapNode("batch");
// Add a "docs" node as an array.
UNode docsNode = batchNode.addArrayNode("docs");
for (DBObject dbObj : m_dbObjList) {
docsNode.addChildNode... | java | public UNode toDoc() {
// Root object is a MAP called "batch".
UNode batchNode = UNode.createMapNode("batch");
// Add a "docs" node as an array.
UNode docsNode = batchNode.addArrayNode("docs");
for (DBObject dbObj : m_dbObjList) {
docsNode.addChildNode... | [
"public",
"UNode",
"toDoc",
"(",
")",
"{",
"// Root object is a MAP called \"batch\".\r",
"UNode",
"batchNode",
"=",
"UNode",
".",
"createMapNode",
"(",
"\"batch\"",
")",
";",
"// Add a \"docs\" node as an array.\r",
"UNode",
"docsNode",
"=",
"batchNode",
".",
"addArray... | Serialize this DBObjectBatch object into a UNode tree and return the root node.
@return Root node of a UNode tree representing this batch update. | [
"Serialize",
"this",
"DBObjectBatch",
"object",
"into",
"a",
"UNode",
"tree",
"and",
"return",
"the",
"root",
"node",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/DBObjectBatch.java#L270-L280 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/DBObjectBatch.java | DBObjectBatch.addObject | public DBObject addObject(String objID, String tableName) {
DBObject dbObj = new DBObject(objID, tableName);
m_dbObjList.add(dbObj);
return dbObj;
} | java | public DBObject addObject(String objID, String tableName) {
DBObject dbObj = new DBObject(objID, tableName);
m_dbObjList.add(dbObj);
return dbObj;
} | [
"public",
"DBObject",
"addObject",
"(",
"String",
"objID",
",",
"String",
"tableName",
")",
"{",
"DBObject",
"dbObj",
"=",
"new",
"DBObject",
"(",
"objID",
",",
"tableName",
")",
";",
"m_dbObjList",
".",
"add",
"(",
"dbObj",
")",
";",
"return",
"dbObj",
... | Create a new DBObject with the given object ID and table name, add it to this
DBObjectBatch, and return it.
@param objID New DBObject's object ID, if any.
@param tableName New DBObject's table name, if any.
@return New DBObject. | [
"Create",
"a",
"new",
"DBObject",
"with",
"the",
"given",
"object",
"ID",
"and",
"table",
"name",
"add",
"it",
"to",
"this",
"DBObjectBatch",
"and",
"return",
"it",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/DBObjectBatch.java#L303-L307 | train |
QSFT/Doradus | doradus-jetty/src/main/java/com/dell/doradus/server/JettyWebServer.java | JettyWebServer.configureJettyServer | private Server configureJettyServer() {
LinkedBlockingQueue<Runnable> taskQueue = new LinkedBlockingQueue<Runnable>(m_maxTaskQueue);
QueuedThreadPool threadPool = new QueuedThreadPool(m_maxconns, m_defaultMinThreads, m_defaultIdleTimeout,
taskQueue);
Server server = new Server(thread... | java | private Server configureJettyServer() {
LinkedBlockingQueue<Runnable> taskQueue = new LinkedBlockingQueue<Runnable>(m_maxTaskQueue);
QueuedThreadPool threadPool = new QueuedThreadPool(m_maxconns, m_defaultMinThreads, m_defaultIdleTimeout,
taskQueue);
Server server = new Server(thread... | [
"private",
"Server",
"configureJettyServer",
"(",
")",
"{",
"LinkedBlockingQueue",
"<",
"Runnable",
">",
"taskQueue",
"=",
"new",
"LinkedBlockingQueue",
"<",
"Runnable",
">",
"(",
"m_maxTaskQueue",
")",
";",
"QueuedThreadPool",
"threadPool",
"=",
"new",
"QueuedThrea... | Create, configure, and return the Jetty Server object. | [
"Create",
"configure",
"and",
"return",
"the",
"Jetty",
"Server",
"object",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-jetty/src/main/java/com/dell/doradus/server/JettyWebServer.java#L157-L164 | train |
QSFT/Doradus | doradus-jetty/src/main/java/com/dell/doradus/server/JettyWebServer.java | JettyWebServer.configureConnector | private ServerConnector configureConnector() {
ServerConnector connector = null;
if (m_tls) {
connector = createSSLConnector();
} else {
// Unsecured connector
connector = new ServerConnector(m_jettyServer);
}
if (m_restaddr != null) {
... | java | private ServerConnector configureConnector() {
ServerConnector connector = null;
if (m_tls) {
connector = createSSLConnector();
} else {
// Unsecured connector
connector = new ServerConnector(m_jettyServer);
}
if (m_restaddr != null) {
... | [
"private",
"ServerConnector",
"configureConnector",
"(",
")",
"{",
"ServerConnector",
"connector",
"=",
"null",
";",
"if",
"(",
"m_tls",
")",
"{",
"connector",
"=",
"createSSLConnector",
"(",
")",
";",
"}",
"else",
"{",
"// Unsecured connector",
"connector",
"="... | Create, configure, and return the ServerConnector object. | [
"Create",
"configure",
"and",
"return",
"the",
"ServerConnector",
"object",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-jetty/src/main/java/com/dell/doradus/server/JettyWebServer.java#L167-L182 | train |
QSFT/Doradus | doradus-jetty/src/main/java/com/dell/doradus/server/JettyWebServer.java | JettyWebServer.configureHandler | private ServletHandler configureHandler(String servletClassName) {
ServletHandler handler = new ServletHandler();
handler.addServletWithMapping(servletClassName, "/*");
return handler;
} | java | private ServletHandler configureHandler(String servletClassName) {
ServletHandler handler = new ServletHandler();
handler.addServletWithMapping(servletClassName, "/*");
return handler;
} | [
"private",
"ServletHandler",
"configureHandler",
"(",
"String",
"servletClassName",
")",
"{",
"ServletHandler",
"handler",
"=",
"new",
"ServletHandler",
"(",
")",
";",
"handler",
".",
"addServletWithMapping",
"(",
"servletClassName",
",",
"\"/*\"",
")",
";",
"return... | Create, configure, and return the ServletHandler object. | [
"Create",
"configure",
"and",
"return",
"the",
"ServletHandler",
"object",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-jetty/src/main/java/com/dell/doradus/server/JettyWebServer.java#L185-L189 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/Task.java | Task.run | @Override
public final void run() {
String taskID = m_taskRecord.getTaskID();
m_logger.debug("Starting task '{}' in tenant '{}'", taskID, m_tenant);
try {
TaskManagerService.instance().registerTaskStarted(this);
m_lastProgressTimestamp = System.currentTimeMillis();
... | java | @Override
public final void run() {
String taskID = m_taskRecord.getTaskID();
m_logger.debug("Starting task '{}' in tenant '{}'", taskID, m_tenant);
try {
TaskManagerService.instance().registerTaskStarted(this);
m_lastProgressTimestamp = System.currentTimeMillis();
... | [
"@",
"Override",
"public",
"final",
"void",
"run",
"(",
")",
"{",
"String",
"taskID",
"=",
"m_taskRecord",
".",
"getTaskID",
"(",
")",
";",
"m_logger",
".",
"debug",
"(",
"\"Starting task '{}' in tenant '{}'\"",
",",
"taskID",
",",
"m_tenant",
")",
";",
"try... | Called by the TaskManagerService to begin the execution of the task. | [
"Called",
"by",
"the",
"TaskManagerService",
"to",
"begin",
"the",
"execution",
"of",
"the",
"task",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/Task.java#L110-L127 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/Task.java | Task.setTaskStart | private void setTaskStart() {
m_taskRecord.setProperty(TaskRecord.PROP_EXECUTOR, m_hostID);
m_taskRecord.setProperty(TaskRecord.PROP_START_TIME, Long.toString(System.currentTimeMillis()));
m_taskRecord.setProperty(TaskRecord.PROP_FINISH_TIME, null);
m_taskRecord.setProperty(TaskRecord.PR... | java | private void setTaskStart() {
m_taskRecord.setProperty(TaskRecord.PROP_EXECUTOR, m_hostID);
m_taskRecord.setProperty(TaskRecord.PROP_START_TIME, Long.toString(System.currentTimeMillis()));
m_taskRecord.setProperty(TaskRecord.PROP_FINISH_TIME, null);
m_taskRecord.setProperty(TaskRecord.PR... | [
"private",
"void",
"setTaskStart",
"(",
")",
"{",
"m_taskRecord",
".",
"setProperty",
"(",
"TaskRecord",
".",
"PROP_EXECUTOR",
",",
"m_hostID",
")",
";",
"m_taskRecord",
".",
"setProperty",
"(",
"TaskRecord",
".",
"PROP_START_TIME",
",",
"Long",
".",
"toString",... | Update the job status record that shows this job has started. | [
"Update",
"the",
"job",
"status",
"record",
"that",
"shows",
"this",
"job",
"has",
"started",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/Task.java#L170-L179 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/Task.java | Task.setTaskFailed | private void setTaskFailed(String reason) {
m_taskRecord.setProperty(TaskRecord.PROP_EXECUTOR, m_hostID);
m_taskRecord.setProperty(TaskRecord.PROP_FINISH_TIME, Long.toString(System.currentTimeMillis()));
m_taskRecord.setProperty(TaskRecord.PROP_FAIL_REASON, reason);
m_taskRecord.setStatu... | java | private void setTaskFailed(String reason) {
m_taskRecord.setProperty(TaskRecord.PROP_EXECUTOR, m_hostID);
m_taskRecord.setProperty(TaskRecord.PROP_FINISH_TIME, Long.toString(System.currentTimeMillis()));
m_taskRecord.setProperty(TaskRecord.PROP_FAIL_REASON, reason);
m_taskRecord.setStatu... | [
"private",
"void",
"setTaskFailed",
"(",
"String",
"reason",
")",
"{",
"m_taskRecord",
".",
"setProperty",
"(",
"TaskRecord",
".",
"PROP_EXECUTOR",
",",
"m_hostID",
")",
";",
"m_taskRecord",
".",
"setProperty",
"(",
"TaskRecord",
".",
"PROP_FINISH_TIME",
",",
"L... | Update the job status record that shows this job has failed. | [
"Update",
"the",
"job",
"status",
"record",
"that",
"shows",
"this",
"job",
"has",
"failed",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/Task.java#L198-L204 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java | RESTClient.reconnect | private void reconnect() throws IOException {
// First ensure we're closed.
close();
// Attempt to re-open.
try {
createSocket();
} catch (Exception e) {
e.printStackTrace();
throw new IOException("Cannot connect to server", e);
}
m_inStream = m_s... | java | private void reconnect() throws IOException {
// First ensure we're closed.
close();
// Attempt to re-open.
try {
createSocket();
} catch (Exception e) {
e.printStackTrace();
throw new IOException("Cannot connect to server", e);
}
m_inStream = m_s... | [
"private",
"void",
"reconnect",
"(",
")",
"throws",
"IOException",
"{",
"// First ensure we're closed.\r",
"close",
"(",
")",
";",
"// Attempt to re-open.\r",
"try",
"{",
"createSocket",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"e",
".",
... | Attempt to reconnect to the Doradus server | [
"Attempt",
"to",
"reconnect",
"to",
"the",
"Doradus",
"server"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L352-L365 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java | RESTClient.sendAndReceive | private RESTResponse sendAndReceive(HttpMethod method,
String uri,
Map<String, String> headers,
byte[] body) throws IOException {
// Add standard headers... | java | private RESTResponse sendAndReceive(HttpMethod method,
String uri,
Map<String, String> headers,
byte[] body) throws IOException {
// Add standard headers... | [
"private",
"RESTResponse",
"sendAndReceive",
"(",
"HttpMethod",
"method",
",",
"String",
"uri",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
",",
"byte",
"[",
"]",
"body",
")",
"throws",
"IOException",
"{",
"// Add standard headers\r",
"assert",
"... | Add standard headers to the given request and send it. | [
"Add",
"standard",
"headers",
"to",
"the",
"given",
"request",
"and",
"send",
"it",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L368-L403 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java | RESTClient.sendAndReceive | private RESTResponse sendAndReceive(String header, byte[] body) throws IOException {
// Fail before trying if socket has been closed.
if (isClosed()) {
throw new IOException("Socket has been closed");
}
Exception lastException = null;
for (int attempt ... | java | private RESTResponse sendAndReceive(String header, byte[] body) throws IOException {
// Fail before trying if socket has been closed.
if (isClosed()) {
throw new IOException("Socket has been closed");
}
Exception lastException = null;
for (int attempt ... | [
"private",
"RESTResponse",
"sendAndReceive",
"(",
"String",
"header",
",",
"byte",
"[",
"]",
"body",
")",
"throws",
"IOException",
"{",
"// Fail before trying if socket has been closed.\r",
"if",
"(",
"isClosed",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
... | we reconnect and retry up to MAX_SOCKET_RETRIES before giving up. | [
"we",
"reconnect",
"and",
"retry",
"up",
"to",
"MAX_SOCKET_RETRIES",
"before",
"giving",
"up",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L407-L429 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java | RESTClient.sendRequest | private void sendRequest(String header, byte[] body) throws IOException {
// Send entire message in one write, else suffer the fate of weird TCP/IP stacks.
byte[] headerBytes = Utils.toBytes(header);
byte[] requestBytes = headerBytes;
if (body != null && body.length > 0) {
... | java | private void sendRequest(String header, byte[] body) throws IOException {
// Send entire message in one write, else suffer the fate of weird TCP/IP stacks.
byte[] headerBytes = Utils.toBytes(header);
byte[] requestBytes = headerBytes;
if (body != null && body.length > 0) {
... | [
"private",
"void",
"sendRequest",
"(",
"String",
"header",
",",
"byte",
"[",
"]",
"body",
")",
"throws",
"IOException",
"{",
"// Send entire message in one write, else suffer the fate of weird TCP/IP stacks.\r",
"byte",
"[",
"]",
"headerBytes",
"=",
"Utils",
".",
"toByt... | Send the request represented by the given header and optional body. | [
"Send",
"the",
"request",
"represented",
"by",
"the",
"given",
"header",
"and",
"optional",
"body",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L433-L446 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java | RESTClient.readResponse | private RESTResponse readResponse() throws IOException {
// Read response code from the header line.
HttpCode resultCode = readStatusLine();
// Read and save headers, keeping track of content-length if we find it.
Map<String, String> headers = new HashMap<String, String>();... | java | private RESTResponse readResponse() throws IOException {
// Read response code from the header line.
HttpCode resultCode = readStatusLine();
// Read and save headers, keeping track of content-length if we find it.
Map<String, String> headers = new HashMap<String, String>();... | [
"private",
"RESTResponse",
"readResponse",
"(",
")",
"throws",
"IOException",
"{",
"// Read response code from the header line.\r",
"HttpCode",
"resultCode",
"=",
"readStatusLine",
"(",
")",
";",
"// Read and save headers, keeping track of content-length if we find it.\r",
"Map",
... | a RESTResponse object. | [
"a",
"RESTResponse",
"object",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L450-L498 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java | RESTClient.readStatusLine | private HttpCode readStatusLine() throws IOException {
// Read a line of text, which should be in the format HTTP/<version <code> <reason>
String statusLine = readHeader();
String[] parts = statusLine.split(" +");
if (parts.length < 3) {
throw new IOException("Badly form... | java | private HttpCode readStatusLine() throws IOException {
// Read a line of text, which should be in the format HTTP/<version <code> <reason>
String statusLine = readHeader();
String[] parts = statusLine.split(" +");
if (parts.length < 3) {
throw new IOException("Badly form... | [
"private",
"HttpCode",
"readStatusLine",
"(",
")",
"throws",
"IOException",
"{",
"// Read a line of text, which should be in the format HTTP/<version <code> <reason>\r",
"String",
"statusLine",
"=",
"readHeader",
"(",
")",
";",
"String",
"[",
"]",
"parts",
"=",
"statusLine"... | Read a REST response status line and return the status code from it. | [
"Read",
"a",
"REST",
"response",
"status",
"line",
"and",
"return",
"the",
"status",
"code",
"from",
"it",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L501-L520 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java | RESTClient.createSocket | private void createSocket() throws Exception {
// Some socket options, notably setReceiveBufferSize, must be set before the
// socket is connected. So, first create the socket, then set options, then connect.
if (m_sslParams != null) {
SSLSocketFactory factory = m_sslParams.creat... | java | private void createSocket() throws Exception {
// Some socket options, notably setReceiveBufferSize, must be set before the
// socket is connected. So, first create the socket, then set options, then connect.
if (m_sslParams != null) {
SSLSocketFactory factory = m_sslParams.creat... | [
"private",
"void",
"createSocket",
"(",
")",
"throws",
"Exception",
"{",
"// Some socket options, notably setReceiveBufferSize, must be set before the\r",
"// socket is connected. So, first create the socket, then set options, then connect.\r",
"if",
"(",
"m_sslParams",
"!=",
"null",
"... | Create a socket connection, setting m_socket, using configured parameters. | [
"Create",
"a",
"socket",
"connection",
"setting",
"m_socket",
"using",
"configured",
"parameters",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L558-L572 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java | RESTClient.setSocketOptions | private void setSocketOptions() throws SocketException {
if (DISABLE_NAGLES) {
// Disable Nagle's algorithm (significant on Windows).
m_socket.setTcpNoDelay(true);
m_logger.debug("Nagle's algorithm disabled.");
}
if (USE_CUSTOM_BUFFER_SIZE) {
... | java | private void setSocketOptions() throws SocketException {
if (DISABLE_NAGLES) {
// Disable Nagle's algorithm (significant on Windows).
m_socket.setTcpNoDelay(true);
m_logger.debug("Nagle's algorithm disabled.");
}
if (USE_CUSTOM_BUFFER_SIZE) {
... | [
"private",
"void",
"setSocketOptions",
"(",
")",
"throws",
"SocketException",
"{",
"if",
"(",
"DISABLE_NAGLES",
")",
"{",
"// Disable Nagle's algorithm (significant on Windows).\r",
"m_socket",
".",
"setTcpNoDelay",
"(",
"true",
")",
";",
"m_logger",
".",
"debug",
"("... | Customize socket options | [
"Customize",
"socket",
"options"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTClient.java#L575-L594 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/logservice/ChunkField.java | ChunkField.set | public void set(int[] indexes, int[] offsets, int[] lengths) {
m_size = indexes.length;
m_valuesCount = offsets.length;
m_offsets = offsets;
m_lengths = lengths;
m_prefixes = new int[offsets.length];
m_suffixes = new int[offsets.length];
m_indexes = indexes;
} | java | public void set(int[] indexes, int[] offsets, int[] lengths) {
m_size = indexes.length;
m_valuesCount = offsets.length;
m_offsets = offsets;
m_lengths = lengths;
m_prefixes = new int[offsets.length];
m_suffixes = new int[offsets.length];
m_indexes = indexes;
} | [
"public",
"void",
"set",
"(",
"int",
"[",
"]",
"indexes",
",",
"int",
"[",
"]",
"offsets",
",",
"int",
"[",
"]",
"lengths",
")",
"{",
"m_size",
"=",
"indexes",
".",
"length",
";",
"m_valuesCount",
"=",
"offsets",
".",
"length",
";",
"m_offsets",
"=",... | for synthetic fields | [
"for",
"synthetic",
"fields"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/logservice/ChunkField.java#L135-L143 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLSchemaManager.java | CQLSchemaManager.keyspaceDefaultsToCQLString | @SuppressWarnings("unchecked")
private String keyspaceDefaultsToCQLString() {
// Default defaults:
boolean durable_writes = true;
Map<String, Object> replication = new HashMap<String, Object>();
replication.put("class", "SimpleStrategy");
replication.put("replication_factor",... | java | @SuppressWarnings("unchecked")
private String keyspaceDefaultsToCQLString() {
// Default defaults:
boolean durable_writes = true;
Map<String, Object> replication = new HashMap<String, Object>();
replication.put("class", "SimpleStrategy");
replication.put("replication_factor",... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"String",
"keyspaceDefaultsToCQLString",
"(",
")",
"{",
"// Default defaults:",
"boolean",
"durable_writes",
"=",
"true",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"replication",
"=",
"new",
"Hash... | Allow RF to be overridden with ReplicationFactor in the given options. | [
"Allow",
"RF",
"to",
"be",
"overridden",
"with",
"ReplicationFactor",
"in",
"the",
"given",
"options",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLSchemaManager.java#L194-L233 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLSchemaManager.java | CQLSchemaManager.mapToCQLString | private static String mapToCQLString(Map<String, Object> valueMap) {
StringBuffer buffer = new StringBuffer();
buffer.append("{");
boolean bFirst = true;
for (String name : valueMap.keySet()) {
if (bFirst) {
bFirst = false;
} else {
... | java | private static String mapToCQLString(Map<String, Object> valueMap) {
StringBuffer buffer = new StringBuffer();
buffer.append("{");
boolean bFirst = true;
for (String name : valueMap.keySet()) {
if (bFirst) {
bFirst = false;
} else {
... | [
"private",
"static",
"String",
"mapToCQLString",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"valueMap",
")",
"{",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"buffer",
".",
"append",
"(",
"\"{\"",
")",
";",
"boolean",
"bFirst",... | Values must be quoted if they aren't literals. | [
"Values",
"must",
"be",
"quoted",
"if",
"they",
"aren",
"t",
"literals",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLSchemaManager.java#L237-L261 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLSchemaManager.java | CQLSchemaManager.executeCQL | private ResultSet executeCQL(String cql) {
m_logger.debug("Executing CQL: {}", cql);
try {
return m_dbservice.getSession().execute(cql);
} catch (Exception e) {
m_logger.error("CQL query failed", e);
m_logger.info(" Query={}", cql);
throw e;
... | java | private ResultSet executeCQL(String cql) {
m_logger.debug("Executing CQL: {}", cql);
try {
return m_dbservice.getSession().execute(cql);
} catch (Exception e) {
m_logger.error("CQL query failed", e);
m_logger.info(" Query={}", cql);
throw e;
... | [
"private",
"ResultSet",
"executeCQL",
"(",
"String",
"cql",
")",
"{",
"m_logger",
".",
"debug",
"(",
"\"Executing CQL: {}\"",
",",
"cql",
")",
";",
"try",
"{",
"return",
"m_dbservice",
".",
"getSession",
"(",
")",
".",
"execute",
"(",
"cql",
")",
";",
"}... | Execute and optionally log the given CQL statement. | [
"Execute",
"and",
"optionally",
"log",
"the",
"given",
"CQL",
"statement",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLSchemaManager.java#L264-L273 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderDataAger.java | SpiderDataAger.checkTable | private void checkTable() {
// Documentation says that "0 xxx" means data-aging is disabled.
if (m_retentionAge.getValue() == 0) {
m_logger.info("Data aging disabled for table: {}", m_tableDef.getTableName());
return;
}
m_logger.info("Checking expired obj... | java | private void checkTable() {
// Documentation says that "0 xxx" means data-aging is disabled.
if (m_retentionAge.getValue() == 0) {
m_logger.info("Data aging disabled for table: {}", m_tableDef.getTableName());
return;
}
m_logger.info("Checking expired obj... | [
"private",
"void",
"checkTable",
"(",
")",
"{",
"// Documentation says that \"0 xxx\" means data-aging is disabled.",
"if",
"(",
"m_retentionAge",
".",
"getValue",
"(",
")",
"==",
"0",
")",
"{",
"m_logger",
".",
"info",
"(",
"\"Data aging disabled for table: {}\"",
",",... | Scan the given table for expired objects relative to the given date. | [
"Scan",
"the",
"given",
"table",
"for",
"expired",
"objects",
"relative",
"to",
"the",
"given",
"date",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderDataAger.java#L75-L114 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderDataAger.java | SpiderDataAger.buildFixedQuery | private String buildFixedQuery(GregorianCalendar expireDate) {
// Query: '{aging field} <= "{expire date}"', fetching the _ID and
// aging field, up to a batch full at a time.
StringBuilder fixedParams = new StringBuilder();
fixedParams.append("q=");
fixedParams.append(m_agingFie... | java | private String buildFixedQuery(GregorianCalendar expireDate) {
// Query: '{aging field} <= "{expire date}"', fetching the _ID and
// aging field, up to a batch full at a time.
StringBuilder fixedParams = new StringBuilder();
fixedParams.append("q=");
fixedParams.append(m_agingFie... | [
"private",
"String",
"buildFixedQuery",
"(",
"GregorianCalendar",
"expireDate",
")",
"{",
"// Query: '{aging field} <= \"{expire date}\"', fetching the _ID and",
"// aging field, up to a batch full at a time.",
"StringBuilder",
"fixedParams",
"=",
"new",
"StringBuilder",
"(",
")",
... | Build the fixed part of the query that fetches a batch of object IDs. | [
"Build",
"the",
"fixed",
"part",
"of",
"the",
"query",
"that",
"fetches",
"a",
"batch",
"of",
"object",
"IDs",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderDataAger.java#L117-L134 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderDataAger.java | SpiderDataAger.deleteBatch | private boolean deleteBatch(List<String> objIDs) {
if (objIDs.size() == 0) {
return false;
}
m_logger.debug("Deleting batch of {} objects from {}", objIDs.size(), m_tableDef.getTableName());
BatchObjectUpdater batchUpdater = new BatchObjectUpdater(m_tableDef);
BatchRe... | java | private boolean deleteBatch(List<String> objIDs) {
if (objIDs.size() == 0) {
return false;
}
m_logger.debug("Deleting batch of {} objects from {}", objIDs.size(), m_tableDef.getTableName());
BatchObjectUpdater batchUpdater = new BatchObjectUpdater(m_tableDef);
BatchRe... | [
"private",
"boolean",
"deleteBatch",
"(",
"List",
"<",
"String",
">",
"objIDs",
")",
"{",
"if",
"(",
"objIDs",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"m_logger",
".",
"debug",
"(",
"\"Deleting batch of {} objects from {}\"... | update failed or we didn't execute an update. | [
"update",
"failed",
"or",
"we",
"didn",
"t",
"execute",
"an",
"update",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderDataAger.java#L138-L150 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java | CQLTransaction.commit | public void commit(DBTransaction transaction) {
try {
applyUpdates(transaction);
} catch (Exception e) {
m_logger.error("Updates failed", e);
throw e;
} finally {
transaction.clear();
}
} | java | public void commit(DBTransaction transaction) {
try {
applyUpdates(transaction);
} catch (Exception e) {
m_logger.error("Updates failed", e);
throw e;
} finally {
transaction.clear();
}
} | [
"public",
"void",
"commit",
"(",
"DBTransaction",
"transaction",
")",
"{",
"try",
"{",
"applyUpdates",
"(",
"transaction",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"m_logger",
".",
"error",
"(",
"\"Updates failed\"",
",",
"e",
")",
";",
"... | Apply the updates accumulated in this transaction. The updates are cleared even if
the update fails. | [
"Apply",
"the",
"updates",
"accumulated",
"in",
"this",
"transaction",
".",
"The",
"updates",
"are",
"cleared",
"even",
"if",
"the",
"update",
"fails",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java#L53-L62 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java | CQLTransaction.applyUpdates | private void applyUpdates(DBTransaction transaction) {
if (transaction.getMutationsCount() == 0) {
m_logger.debug("Skipping commit with no updates");
} else if (m_dbservice.getParamBoolean("async_updates")) {
executeUpdatesAsynchronous(transaction);
} else {
e... | java | private void applyUpdates(DBTransaction transaction) {
if (transaction.getMutationsCount() == 0) {
m_logger.debug("Skipping commit with no updates");
} else if (m_dbservice.getParamBoolean("async_updates")) {
executeUpdatesAsynchronous(transaction);
} else {
e... | [
"private",
"void",
"applyUpdates",
"(",
"DBTransaction",
"transaction",
")",
"{",
"if",
"(",
"transaction",
".",
"getMutationsCount",
"(",
")",
"==",
"0",
")",
"{",
"m_logger",
".",
"debug",
"(",
"\"Skipping commit with no updates\"",
")",
";",
"}",
"else",
"i... | Execute a batch statement that applies all updates in this transaction. | [
"Execute",
"a",
"batch",
"statement",
"that",
"applies",
"all",
"updates",
"in",
"this",
"transaction",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java#L65-L73 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java | CQLTransaction.executeUpdatesAsynchronous | private void executeUpdatesAsynchronous(DBTransaction transaction) {
Collection<BoundStatement> mutations = getMutations(transaction);
List<ResultSetFuture> futureList = new ArrayList<>(mutations.size());
for(BoundStatement mutation: mutations) {
ResultSetFuture future = m_dbservice.... | java | private void executeUpdatesAsynchronous(DBTransaction transaction) {
Collection<BoundStatement> mutations = getMutations(transaction);
List<ResultSetFuture> futureList = new ArrayList<>(mutations.size());
for(BoundStatement mutation: mutations) {
ResultSetFuture future = m_dbservice.... | [
"private",
"void",
"executeUpdatesAsynchronous",
"(",
"DBTransaction",
"transaction",
")",
"{",
"Collection",
"<",
"BoundStatement",
">",
"mutations",
"=",
"getMutations",
"(",
"transaction",
")",
";",
"List",
"<",
"ResultSetFuture",
">",
"futureList",
"=",
"new",
... | Execute all updates asynchronously and wait for results. | [
"Execute",
"all",
"updates",
"asynchronously",
"and",
"wait",
"for",
"results",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java#L76-L87 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java | CQLTransaction.executeUpdatesSynchronous | private void executeUpdatesSynchronous(DBTransaction transaction) {
BatchStatement batchState = new BatchStatement(Type.UNLOGGED);
batchState.addAll(getMutations(transaction));
executeBatch(batchState);
} | java | private void executeUpdatesSynchronous(DBTransaction transaction) {
BatchStatement batchState = new BatchStatement(Type.UNLOGGED);
batchState.addAll(getMutations(transaction));
executeBatch(batchState);
} | [
"private",
"void",
"executeUpdatesSynchronous",
"(",
"DBTransaction",
"transaction",
")",
"{",
"BatchStatement",
"batchState",
"=",
"new",
"BatchStatement",
"(",
"Type",
".",
"UNLOGGED",
")",
";",
"batchState",
".",
"addAll",
"(",
"getMutations",
"(",
"transaction",... | Execute all updates and deletes using synchronous statements. | [
"Execute",
"all",
"updates",
"and",
"deletes",
"using",
"synchronous",
"statements",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java#L90-L94 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java | CQLTransaction.addColumnUpdate | private BoundStatement addColumnUpdate(String tableName, String key, DColumn column, boolean isBinaryValue) {
PreparedStatement prepState = m_dbservice.getPreparedUpdate(Update.INSERT_ROW, tableName);
BoundStatement boundState = prepState.bind();
boundState.setString(0, key);
boundState.... | java | private BoundStatement addColumnUpdate(String tableName, String key, DColumn column, boolean isBinaryValue) {
PreparedStatement prepState = m_dbservice.getPreparedUpdate(Update.INSERT_ROW, tableName);
BoundStatement boundState = prepState.bind();
boundState.setString(0, key);
boundState.... | [
"private",
"BoundStatement",
"addColumnUpdate",
"(",
"String",
"tableName",
",",
"String",
"key",
",",
"DColumn",
"column",
",",
"boolean",
"isBinaryValue",
")",
"{",
"PreparedStatement",
"prepState",
"=",
"m_dbservice",
".",
"getPreparedUpdate",
"(",
"Update",
".",... | Create and return a BoundStatement for the given column update. | [
"Create",
"and",
"return",
"a",
"BoundStatement",
"for",
"the",
"given",
"column",
"update",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java#L115-L126 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java | CQLTransaction.addColumnDelete | private BoundStatement addColumnDelete(String tableName, String key, String colName) {
PreparedStatement prepState = m_dbservice.getPreparedUpdate(Update.DELETE_COLUMN, tableName);
BoundStatement boundState = prepState.bind();
boundState.setString(0, key);
boundState.setString(1, colName... | java | private BoundStatement addColumnDelete(String tableName, String key, String colName) {
PreparedStatement prepState = m_dbservice.getPreparedUpdate(Update.DELETE_COLUMN, tableName);
BoundStatement boundState = prepState.bind();
boundState.setString(0, key);
boundState.setString(1, colName... | [
"private",
"BoundStatement",
"addColumnDelete",
"(",
"String",
"tableName",
",",
"String",
"key",
",",
"String",
"colName",
")",
"{",
"PreparedStatement",
"prepState",
"=",
"m_dbservice",
".",
"getPreparedUpdate",
"(",
"Update",
".",
"DELETE_COLUMN",
",",
"tableName... | Create and return a BoundStatement that deletes the given column. | [
"Create",
"and",
"return",
"a",
"BoundStatement",
"that",
"deletes",
"the",
"given",
"column",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java#L130-L136 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java | CQLTransaction.addRowDelete | private BoundStatement addRowDelete(String tableName, String key) {
PreparedStatement prepState = m_dbservice.getPreparedUpdate(Update.DELETE_ROW, tableName);
BoundStatement boundState = prepState.bind();
boundState.setString(0, key);
return boundState;
} | java | private BoundStatement addRowDelete(String tableName, String key) {
PreparedStatement prepState = m_dbservice.getPreparedUpdate(Update.DELETE_ROW, tableName);
BoundStatement boundState = prepState.bind();
boundState.setString(0, key);
return boundState;
} | [
"private",
"BoundStatement",
"addRowDelete",
"(",
"String",
"tableName",
",",
"String",
"key",
")",
"{",
"PreparedStatement",
"prepState",
"=",
"m_dbservice",
".",
"getPreparedUpdate",
"(",
"Update",
".",
"DELETE_ROW",
",",
"tableName",
")",
";",
"BoundStatement",
... | Create and return a BoundStatement that deletes the given row. | [
"Create",
"and",
"return",
"a",
"BoundStatement",
"that",
"deletes",
"the",
"given",
"row",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java#L139-L144 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java | CQLTransaction.executeBatch | private void executeBatch(BatchStatement batchState) {
if (batchState.size() > 0) {
m_logger.debug("Executing synchronous batch with {} statements", batchState.size());
m_dbservice.getSession().execute(batchState);
}
} | java | private void executeBatch(BatchStatement batchState) {
if (batchState.size() > 0) {
m_logger.debug("Executing synchronous batch with {} statements", batchState.size());
m_dbservice.getSession().execute(batchState);
}
} | [
"private",
"void",
"executeBatch",
"(",
"BatchStatement",
"batchState",
")",
"{",
"if",
"(",
"batchState",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"m_logger",
".",
"debug",
"(",
"\"Executing synchronous batch with {} statements\"",
",",
"batchState",
".",
"si... | Execute and given update statement. | [
"Execute",
"and",
"given",
"update",
"statement",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLTransaction.java#L148-L153 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/mbeans/ServerMonitor.java | ServerMonitor.onRequestRejected | public synchronized void onRequestRejected(String reason) {
allRequestsTracker.onRequestRejected(reason);
recentRequestsTracker.onRequestRejected(reason);
meter.mark();
} | java | public synchronized void onRequestRejected(String reason) {
allRequestsTracker.onRequestRejected(reason);
recentRequestsTracker.onRequestRejected(reason);
meter.mark();
} | [
"public",
"synchronized",
"void",
"onRequestRejected",
"(",
"String",
"reason",
")",
"{",
"allRequestsTracker",
".",
"onRequestRejected",
"(",
"reason",
")",
";",
"recentRequestsTracker",
".",
"onRequestRejected",
"(",
"reason",
")",
";",
"meter",
".",
"mark",
"("... | Registers an invalid request rejected by the server. | [
"Registers",
"an",
"invalid",
"request",
"rejected",
"by",
"the",
"server",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/mbeans/ServerMonitor.java#L231-L235 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/OLAPSession.java | OLAPSession.deleteShard | public boolean deleteShard(String shard) {
Utils.require(!Utils.isEmpty(shard), "shard");
try {
// Send a DELETE request to "/{application}/_shards/{shard}"
StringBuilder uri = new StringBuilder(Utils.isEmpty(m_restClient.getApiPrefix()) ? "" : "/" + m_restClient.getApiPrefix... | java | public boolean deleteShard(String shard) {
Utils.require(!Utils.isEmpty(shard), "shard");
try {
// Send a DELETE request to "/{application}/_shards/{shard}"
StringBuilder uri = new StringBuilder(Utils.isEmpty(m_restClient.getApiPrefix()) ? "" : "/" + m_restClient.getApiPrefix... | [
"public",
"boolean",
"deleteShard",
"(",
"String",
"shard",
")",
"{",
"Utils",
".",
"require",
"(",
"!",
"Utils",
".",
"isEmpty",
"(",
"shard",
")",
",",
"\"shard\"",
")",
";",
"try",
"{",
"// Send a DELETE request to \"/{application}/_shards/{shard}\"\r",
"String... | Delete the OLAP shard with the given name belonging to this session's application.
True is returned if the delete was successful. An exception is thrown if an error
occurred.
@param shard Shard name.
@return True if the shard was successfully deleted. | [
"Delete",
"the",
"OLAP",
"shard",
"with",
"the",
"given",
"name",
"belonging",
"to",
"this",
"session",
"s",
"application",
".",
"True",
"is",
"returned",
"if",
"the",
"delete",
"was",
"successful",
".",
"An",
"exception",
"is",
"thrown",
"if",
"an",
"erro... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/OLAPSession.java#L133-L149 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/OLAPSession.java | OLAPSession.getShardNames | public Collection<String> getShardNames() {
List<String> shardNames = new ArrayList<>();
try {
// Send a GET request to "/{application}/_shards"
StringBuilder uri = new StringBuilder(Utils.isEmpty(m_restClient.getApiPrefix()) ? "" : "/" + m_restClient.getApiPrefix()); ... | java | public Collection<String> getShardNames() {
List<String> shardNames = new ArrayList<>();
try {
// Send a GET request to "/{application}/_shards"
StringBuilder uri = new StringBuilder(Utils.isEmpty(m_restClient.getApiPrefix()) ? "" : "/" + m_restClient.getApiPrefix()); ... | [
"public",
"Collection",
"<",
"String",
">",
"getShardNames",
"(",
")",
"{",
"List",
"<",
"String",
">",
"shardNames",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"// Send a GET request to \"/{application}/_shards\"\r",
"StringBuilder",
"uri",
"=",
... | Get a list of all shard names owned by this application. If there are no shards
with data yet, an empty collection is returned.
@return Collection of shard names, possibly empty. | [
"Get",
"a",
"list",
"of",
"all",
"shard",
"names",
"owned",
"by",
"this",
"application",
".",
"If",
"there",
"are",
"no",
"shards",
"with",
"data",
"yet",
"an",
"empty",
"collection",
"is",
"returned",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/OLAPSession.java#L157-L181 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/OLAPSession.java | OLAPSession.getShardStats | public UNode getShardStats(String shardName) {
try {
// Send a GET request to "/{application}/_shards/{shard}"
StringBuilder uri = new StringBuilder(Utils.isEmpty(m_restClient.getApiPrefix()) ? "" : "/" + m_restClient.getApiPrefix());
uri.append("... | java | public UNode getShardStats(String shardName) {
try {
// Send a GET request to "/{application}/_shards/{shard}"
StringBuilder uri = new StringBuilder(Utils.isEmpty(m_restClient.getApiPrefix()) ? "" : "/" + m_restClient.getApiPrefix());
uri.append("... | [
"public",
"UNode",
"getShardStats",
"(",
"String",
"shardName",
")",
"{",
"try",
"{",
"// Send a GET request to \"/{application}/_shards/{shard}\"\r",
"StringBuilder",
"uri",
"=",
"new",
"StringBuilder",
"(",
"Utils",
".",
"isEmpty",
"(",
"m_restClient",
".",
"getApiPre... | Get statistics for the given shard name. Since the response to this command is
subject to change, the command result is parsed into a UNode, and the root object
is returned. An exception is thrown if the given shard name does not exist or does
not have any data.
@param shardName Name of a shard to query.
@return ... | [
"Get",
"statistics",
"for",
"the",
"given",
"shard",
"name",
".",
"Since",
"the",
"response",
"to",
"this",
"command",
"is",
"subject",
"to",
"change",
"the",
"command",
"result",
"is",
"parsed",
"into",
"a",
"UNode",
"and",
"the",
"root",
"object",
"is",
... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/OLAPSession.java#L192-L207 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/OLAPSession.java | OLAPSession.mergeShard | public boolean mergeShard(String shard, Date expireDate) {
Utils.require(!Utils.isEmpty(shard), "shard");
try {
// Send a POST request to "/{application}/_shards/{shard}[?expire-date=<date>]"
StringBuilder uri = new StringBuilder(Utils.isEmpty(m_restClient.getApiPrefix()) ? "... | java | public boolean mergeShard(String shard, Date expireDate) {
Utils.require(!Utils.isEmpty(shard), "shard");
try {
// Send a POST request to "/{application}/_shards/{shard}[?expire-date=<date>]"
StringBuilder uri = new StringBuilder(Utils.isEmpty(m_restClient.getApiPrefix()) ? "... | [
"public",
"boolean",
"mergeShard",
"(",
"String",
"shard",
",",
"Date",
"expireDate",
")",
"{",
"Utils",
".",
"require",
"(",
"!",
"Utils",
".",
"isEmpty",
"(",
"shard",
")",
",",
"\"shard\"",
")",
";",
"try",
"{",
"// Send a POST request to \"/{application}/_... | Request a merge of the OLAP shard with the given name belonging to this session's
application. Optionally set the shard's expire-date to the given value. True is
returned if the merge was successful. An exception is thrown if an error occurred.
@param shard Shard name.
@param expireDate Optional value for s... | [
"Request",
"a",
"merge",
"of",
"the",
"OLAP",
"shard",
"with",
"the",
"given",
"name",
"belonging",
"to",
"this",
"session",
"s",
"application",
".",
"Optionally",
"set",
"the",
"shard",
"s",
"expire",
"-",
"date",
"to",
"the",
"given",
"value",
".",
"Tr... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/OLAPSession.java#L219-L239 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.allAlphaNumUnderscore | public static boolean allAlphaNumUnderscore(String string) {
if (string == null || string.length() == 0) {
return false;
}
for (int index = 0; index < string.length(); index++) {
char ch = string.charAt(index);
if (!isLetter(ch) && !isDigit(ch) && ch != ... | java | public static boolean allAlphaNumUnderscore(String string) {
if (string == null || string.length() == 0) {
return false;
}
for (int index = 0; index < string.length(); index++) {
char ch = string.charAt(index);
if (!isLetter(ch) && !isDigit(ch) && ch != ... | [
"public",
"static",
"boolean",
"allAlphaNumUnderscore",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"string",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"index",
"=",
... | Return true if the given string contains only letters, digits, and underscores.
@param string String to be tested.
@return True if the string is not null, not empty, and contains only
letters, digits, and underscores. | [
"Return",
"true",
"if",
"the",
"given",
"string",
"contains",
"only",
"letters",
"digits",
"and",
"underscores",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L97-L108 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.base64ToHex | public static String base64ToHex(String base64Value) throws IllegalArgumentException {
byte[] binary = base64ToBinary(base64Value);
return DatatypeConverter.printHexBinary(binary);
} | java | public static String base64ToHex(String base64Value) throws IllegalArgumentException {
byte[] binary = base64ToBinary(base64Value);
return DatatypeConverter.printHexBinary(binary);
} | [
"public",
"static",
"String",
"base64ToHex",
"(",
"String",
"base64Value",
")",
"throws",
"IllegalArgumentException",
"{",
"byte",
"[",
"]",
"binary",
"=",
"base64ToBinary",
"(",
"base64Value",
")",
";",
"return",
"DatatypeConverter",
".",
"printHexBinary",
"(",
"... | Decode the given Base64-encoded String to binary and then return as a string of hex
digits.
@param base64Value Base64-encoded string.
@return Decoded binary value re-encoded as a hex string.
@throws IllegalArgumentException If the given string is not a valid Base64 value. | [
"Decode",
"the",
"given",
"Base64",
"-",
"encoded",
"String",
"to",
"binary",
"and",
"then",
"return",
"as",
"a",
"string",
"of",
"hex",
"digits",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L151-L154 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.base64FromHex | public static String base64FromHex(String hexValue) throws IllegalArgumentException {
byte[] binary = DatatypeConverter.parseHexBinary(hexValue);
return base64FromBinary(binary);
} | java | public static String base64FromHex(String hexValue) throws IllegalArgumentException {
byte[] binary = DatatypeConverter.parseHexBinary(hexValue);
return base64FromBinary(binary);
} | [
"public",
"static",
"String",
"base64FromHex",
"(",
"String",
"hexValue",
")",
"throws",
"IllegalArgumentException",
"{",
"byte",
"[",
"]",
"binary",
"=",
"DatatypeConverter",
".",
"parseHexBinary",
"(",
"hexValue",
")",
";",
"return",
"base64FromBinary",
"(",
"bi... | Decode the given hex string to binary and then re-encoded it as a Base64 string.
@param hexValue String of hexadecimal characters.
@return Decoded binary value re-encoded with Base64.
@throws IllegalArgumentException If the given value is null or invalid. | [
"Decode",
"the",
"given",
"hex",
"string",
"to",
"binary",
"and",
"then",
"re",
"-",
"encoded",
"it",
"as",
"a",
"Base64",
"string",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L174-L177 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.base64ToString | public static String base64ToString(String base64Value) {
Utils.require(base64Value.length() % 4 == 0,
"Invalid base64 value (must be a multiple of 4 chars): " + base64Value);
byte[] utf8String = DatatypeConverter.parseBase64Binary(base64Value);
return toString(utf8Stri... | java | public static String base64ToString(String base64Value) {
Utils.require(base64Value.length() % 4 == 0,
"Invalid base64 value (must be a multiple of 4 chars): " + base64Value);
byte[] utf8String = DatatypeConverter.parseBase64Binary(base64Value);
return toString(utf8Stri... | [
"public",
"static",
"String",
"base64ToString",
"(",
"String",
"base64Value",
")",
"{",
"Utils",
".",
"require",
"(",
"base64Value",
".",
"length",
"(",
")",
"%",
"4",
"==",
"0",
",",
"\"Invalid base64 value (must be a multiple of 4 chars): \"",
"+",
"base64Value",
... | Decode the given base64 value to binary, then decode the result as a UTF-8 sequence
and return the resulting String.
@param base64Value Base64-encoded value of a UTF-8 encoded string.
@return Decoded string value. | [
"Decode",
"the",
"given",
"base64",
"value",
"to",
"binary",
"then",
"decode",
"the",
"result",
"as",
"a",
"UTF",
"-",
"8",
"sequence",
"and",
"return",
"the",
"resulting",
"String",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L212-L217 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.getTimeMicros | public static long getTimeMicros() {
// Use use a dedicated lock object rather than synchronizing on the method, which
// would synchronize on the Utils.class object, which is too coarse-grained.
synchronized (g_lastMicroLock) {
// We use System.currentTimeMillis() * 1000 for com... | java | public static long getTimeMicros() {
// Use use a dedicated lock object rather than synchronizing on the method, which
// would synchronize on the Utils.class object, which is too coarse-grained.
synchronized (g_lastMicroLock) {
// We use System.currentTimeMillis() * 1000 for com... | [
"public",
"static",
"long",
"getTimeMicros",
"(",
")",
"{",
"// Use use a dedicated lock object rather than synchronizing on the method, which\r",
"// would synchronize on the Utils.class object, which is too coarse-grained.\r",
"synchronized",
"(",
"g_lastMicroLock",
")",
"{",
"// We us... | Get the current time in microseconds since the epoch. This method is synchronized
and guarantees that each successive call, even by different threads, returns
increasing values.
@return Current time in microseconds (though not necessarily with microsecond
precision). | [
"Get",
"the",
"current",
"time",
"in",
"microseconds",
"since",
"the",
"epoch",
".",
"This",
"method",
"is",
"synchronized",
"and",
"guarantees",
"that",
"each",
"successive",
"call",
"even",
"by",
"different",
"threads",
"returns",
"increasing",
"values",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L285-L301 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.deWhite | public static String deWhite(byte[] value) {
// If the value contains anything less than a space.
StringBuilder buffer = new StringBuilder();
boolean bAllPrintable = true;
for (byte b : value) {
if ((int)(b & 0xFF) < ' ') {
bAllPrintable = false;
... | java | public static String deWhite(byte[] value) {
// If the value contains anything less than a space.
StringBuilder buffer = new StringBuilder();
boolean bAllPrintable = true;
for (byte b : value) {
if ((int)(b & 0xFF) < ' ') {
bAllPrintable = false;
... | [
"public",
"static",
"String",
"deWhite",
"(",
"byte",
"[",
"]",
"value",
")",
"{",
"// If the value contains anything less than a space.\r",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"bAllPrintable",
"=",
"true",
";",
"for",
... | Create a String by converting each byte directly into a character. However, if any
byte in the given value is less than a space, a hex string is returned instead.
@param value A byte[] to convert.
@return A String of the same values as characters replaced 1-to-1 or converted
into a hex string. | [
"Create",
"a",
"String",
"by",
"converting",
"each",
"byte",
"directly",
"into",
"a",
"character",
".",
"However",
"if",
"any",
"byte",
"in",
"the",
"given",
"value",
"is",
"less",
"than",
"a",
"space",
"a",
"hex",
"string",
"is",
"returned",
"instead",
... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L593-L617 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.getBooleanValue | public static boolean getBooleanValue(String value) throws IllegalArgumentException {
require("true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value),
"'true' or 'false' expected: " + value);
return "true".equalsIgnoreCase(value);
} | java | public static boolean getBooleanValue(String value) throws IllegalArgumentException {
require("true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value),
"'true' or 'false' expected: " + value);
return "true".equalsIgnoreCase(value);
} | [
"public",
"static",
"boolean",
"getBooleanValue",
"(",
"String",
"value",
")",
"throws",
"IllegalArgumentException",
"{",
"require",
"(",
"\"true\"",
".",
"equalsIgnoreCase",
"(",
"value",
")",
"||",
"\"false\"",
".",
"equalsIgnoreCase",
"(",
"value",
")",
",",
... | Verify that the given value is either "true" or "false" and return the corresponding
boolean value. If the value is invalid, an IllegalArgumentException is thrown.
@param value Candidate boolean value in string form.
@return Boolean value of string if valid.
@throws IllegalArgumentException If the valie is not "t... | [
"Verify",
"that",
"the",
"given",
"value",
"is",
"either",
"true",
"or",
"false",
"and",
"return",
"the",
"corresponding",
"boolean",
"value",
".",
"If",
"the",
"value",
"is",
"invalid",
"an",
"IllegalArgumentException",
"is",
"thrown",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L955-L959 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.getElementText | public static String getElementText(Element elem) {
StringBuilder result = new StringBuilder();
NodeList nodeList = elem.getChildNodes();
for (int index = 0; index < nodeList.getLength(); index++) {
Node childNode = nodeList.item(index);
if (childNode != null && (chi... | java | public static String getElementText(Element elem) {
StringBuilder result = new StringBuilder();
NodeList nodeList = elem.getChildNodes();
for (int index = 0; index < nodeList.getLength(); index++) {
Node childNode = nodeList.item(index);
if (childNode != null && (chi... | [
"public",
"static",
"String",
"getElementText",
"(",
"Element",
"elem",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"NodeList",
"nodeList",
"=",
"elem",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"index",
"... | Get the concatenated value of all Text nodes that are immediate children of the
given Element. If the element has no content, it will not have a child Text node.
If it does have content, it will usually have a single child Text node. But in
rare cases it could have multiple child Text nodes. If multiple child Text node... | [
"Get",
"the",
"concatenated",
"value",
"of",
"all",
"Text",
"nodes",
"that",
"are",
"immediate",
"children",
"of",
"the",
"given",
"Element",
".",
"If",
"the",
"element",
"has",
"no",
"content",
"it",
"will",
"not",
"have",
"a",
"child",
"Text",
"node",
... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L1025-L1036 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.md5Encode | public static String md5Encode(String strIn) {
try {
MessageDigest md5 = MessageDigest.getInstance("md5");
byte[] bin = toBytes(strIn);
byte[] bout = md5.digest(bin);
String strOut = javax.xml.bind.DatatypeConverter.printBase64Binary(bout);
retur... | java | public static String md5Encode(String strIn) {
try {
MessageDigest md5 = MessageDigest.getInstance("md5");
byte[] bin = toBytes(strIn);
byte[] bout = md5.digest(bin);
String strOut = javax.xml.bind.DatatypeConverter.printBase64Binary(bout);
retur... | [
"public",
"static",
"String",
"md5Encode",
"(",
"String",
"strIn",
")",
"{",
"try",
"{",
"MessageDigest",
"md5",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"\"md5\"",
")",
";",
"byte",
"[",
"]",
"bin",
"=",
"toBytes",
"(",
"strIn",
")",
";",
"byte",
... | Compute the MD5 of the given string and return it as a Base64-encoded value. The
string is first converted to bytes using UTF-8, and the MD5 is computed on that
value. The MD5 value is 16 bytes, but the Base64-encoded string is 24 chars.
@param strIn A Unicode string.
@return Base64-encoded value of the strings U... | [
"Compute",
"the",
"MD5",
"of",
"the",
"given",
"string",
"and",
"return",
"it",
"as",
"a",
"Base64",
"-",
"encoded",
"value",
".",
"The",
"string",
"is",
"first",
"converted",
"to",
"bytes",
"using",
"UTF",
"-",
"8",
"and",
"the",
"MD5",
"is",
"compute... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L1246-L1256 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.parseXMLDocument | public static Element parseXMLDocument(String xmlDoc) throws IllegalArgumentException {
// Parse the given XML document returning its root document Element if it parses.
// Wrap the document payload as an InputSource.
Reader stringReader = new StringReader(xmlDoc);
InputSource inputS... | java | public static Element parseXMLDocument(String xmlDoc) throws IllegalArgumentException {
// Parse the given XML document returning its root document Element if it parses.
// Wrap the document payload as an InputSource.
Reader stringReader = new StringReader(xmlDoc);
InputSource inputS... | [
"public",
"static",
"Element",
"parseXMLDocument",
"(",
"String",
"xmlDoc",
")",
"throws",
"IllegalArgumentException",
"{",
"// Parse the given XML document returning its root document Element if it parses.\r",
"// Wrap the document payload as an InputSource.\r",
"Reader",
"stringReader"... | Parse the given XML document, creating a DOM tree whose root Document object is
returned. An IllegalArgumentException is thrown if the XML is malformed.
@param xmlDoc XML document as a String.
@return Root document element of the parsed DOM tree.
@throws IllegalArgumentException If the XML is malf... | [
"Parse",
"the",
"given",
"XML",
"document",
"creating",
"a",
"DOM",
"tree",
"whose",
"root",
"Document",
"object",
"is",
"returned",
".",
"An",
"IllegalArgumentException",
"is",
"thrown",
"if",
"the",
"XML",
"is",
"malformed",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L1391-L1409 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.requireEmptyText | public static void requireEmptyText(Node node, String errMsg)
throws IllegalArgumentException {
require((node instanceof Text) || (node instanceof Comment),
errMsg + ": " + node.toString());
if (node instanceof Text) {
Text text = (Text)node;
Str... | java | public static void requireEmptyText(Node node, String errMsg)
throws IllegalArgumentException {
require((node instanceof Text) || (node instanceof Comment),
errMsg + ": " + node.toString());
if (node instanceof Text) {
Text text = (Text)node;
Str... | [
"public",
"static",
"void",
"requireEmptyText",
"(",
"Node",
"node",
",",
"String",
"errMsg",
")",
"throws",
"IllegalArgumentException",
"{",
"require",
"(",
"(",
"node",
"instanceof",
"Text",
")",
"||",
"(",
"node",
"instanceof",
"Comment",
")",
",",
"errMsg"... | Assert that the given org.w3c.doc.Node is a comment element or a Text element and
that it ontains whitespace only, otherwise throw an IllegalArgumentException using
the given error message. This is helpful when nothing is expected at a certain
place in a DOM tree, yet comments or whitespace text nodes can appear.
@par... | [
"Assert",
"that",
"the",
"given",
"org",
".",
"w3c",
".",
"doc",
".",
"Node",
"is",
"a",
"comment",
"element",
"or",
"a",
"Text",
"element",
"and",
"that",
"it",
"ontains",
"whitespace",
"only",
"otherwise",
"throw",
"an",
"IllegalArgumentException",
"using"... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L1510-L1519 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.toAsciiBytes | private static byte[] toAsciiBytes(String str) {
for(int i = 0; i < str.length(); i++) {
if(str.charAt(i) > 127) return null;
}
byte[] bytes = new byte[str.length()];
for(int i = 0; i < str.length(); i++) {
bytes[i] = (byte)str.charAt(i);
}
... | java | private static byte[] toAsciiBytes(String str) {
for(int i = 0; i < str.length(); i++) {
if(str.charAt(i) > 127) return null;
}
byte[] bytes = new byte[str.length()];
for(int i = 0; i < str.length(); i++) {
bytes[i] = (byte)str.charAt(i);
}
... | [
"private",
"static",
"byte",
"[",
"]",
"toAsciiBytes",
"(",
"String",
"str",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"str",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"str",
".",
"charAt",
"(",
"i",
")",
... | return string as bytes if it has only ascii symbols, or null | [
"return",
"string",
"as",
"bytes",
"if",
"it",
"has",
"only",
"ascii",
"symbols",
"or",
"null"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L1793-L1802 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.toAsciiString | private static String toAsciiString(byte[] bytes) {
for(int i = 0; i < bytes.length; i++) {
if(bytes[i] < 0) return null;
}
char[] chars = new char[bytes.length];
for(int i = 0; i < bytes.length; i++) {
chars[i] = (char)bytes[i];
}
return n... | java | private static String toAsciiString(byte[] bytes) {
for(int i = 0; i < bytes.length; i++) {
if(bytes[i] < 0) return null;
}
char[] chars = new char[bytes.length];
for(int i = 0; i < bytes.length; i++) {
chars[i] = (char)bytes[i];
}
return n... | [
"private",
"static",
"String",
"toAsciiString",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"bytes",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"bytes",
"[",
"i",
"]",
"<",
"0",
")",
"re... | return string if bytes have only ascii symbols, or null | [
"return",
"string",
"if",
"bytes",
"have",
"only",
"ascii",
"symbols",
"or",
"null"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L1939-L1948 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.truncateToWeek | public static GregorianCalendar truncateToWeek(GregorianCalendar date) {
// Round the date down to the MONDAY of the same week.
GregorianCalendar result = (GregorianCalendar)date.clone();
switch (result.get(Calendar.DAY_OF_WEEK)) {
case Calendar.TUESDAY: result.add(Calendar.DAY... | java | public static GregorianCalendar truncateToWeek(GregorianCalendar date) {
// Round the date down to the MONDAY of the same week.
GregorianCalendar result = (GregorianCalendar)date.clone();
switch (result.get(Calendar.DAY_OF_WEEK)) {
case Calendar.TUESDAY: result.add(Calendar.DAY... | [
"public",
"static",
"GregorianCalendar",
"truncateToWeek",
"(",
"GregorianCalendar",
"date",
")",
"{",
"// Round the date down to the MONDAY of the same week.\r",
"GregorianCalendar",
"result",
"=",
"(",
"GregorianCalendar",
")",
"date",
".",
"clone",
"(",
")",
";",
"swit... | Truncate the given GregorianCalendar date to the nearest week. This is done by
cloning it and rounding the value down to the closest Monday. If the given date
already occurs on a Monday, a copy of the same date is returned.
@param date A GregorianCalendar object.
@return A copy of the same value, truncat... | [
"Truncate",
"the",
"given",
"GregorianCalendar",
"date",
"to",
"the",
"nearest",
"week",
".",
"This",
"is",
"done",
"by",
"cloning",
"it",
"and",
"rounding",
"the",
"value",
"down",
"to",
"the",
"closest",
"Monday",
".",
"If",
"the",
"given",
"date",
"alre... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L2020-L2033 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java | RESTServlet.validateAndExecuteRequest | private RESTResponse validateAndExecuteRequest(HttpServletRequest request) {
Map<String, String> variableMap = new HashMap<String, String>();
String query = extractQueryParam(request, variableMap);
Tenant tenant = getTenant(variableMap);
// Command matching expects an encoded URI b... | java | private RESTResponse validateAndExecuteRequest(HttpServletRequest request) {
Map<String, String> variableMap = new HashMap<String, String>();
String query = extractQueryParam(request, variableMap);
Tenant tenant = getTenant(variableMap);
// Command matching expects an encoded URI b... | [
"private",
"RESTResponse",
"validateAndExecuteRequest",
"(",
"HttpServletRequest",
"request",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"variableMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"String",
"query",
"=",
... | Execute the given request and return a RESTResponse or throw an appropriate error. | [
"Execute",
"the",
"given",
"request",
"and",
"return",
"a",
"RESTResponse",
"or",
"throw",
"an",
"appropriate",
"error",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java#L170-L197 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java | RESTServlet.getApplication | private ApplicationDefinition getApplication(String uri, Tenant tenant) {
if (uri.length() < 2 || uri.startsWith("/_")) {
return null; // Non-application request
}
String[] pathNodes = uri.substring(1).split("/");
String appName = Utils.urlDecode(pathNodes[0]);
... | java | private ApplicationDefinition getApplication(String uri, Tenant tenant) {
if (uri.length() < 2 || uri.startsWith("/_")) {
return null; // Non-application request
}
String[] pathNodes = uri.substring(1).split("/");
String appName = Utils.urlDecode(pathNodes[0]);
... | [
"private",
"ApplicationDefinition",
"getApplication",
"(",
"String",
"uri",
",",
"Tenant",
"tenant",
")",
"{",
"if",
"(",
"uri",
".",
"length",
"(",
")",
"<",
"2",
"||",
"uri",
".",
"startsWith",
"(",
"\"/_\"",
")",
")",
"{",
"return",
"null",
";",
"//... | Get the definition of the referenced application or null if there is none. | [
"Get",
"the",
"definition",
"of",
"the",
"referenced",
"application",
"or",
"null",
"if",
"there",
"is",
"none",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java#L200-L211 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java | RESTServlet.getTenant | private Tenant getTenant(Map<String, String> variableMap) {
String tenantName = variableMap.get("tenant");
if (Utils.isEmpty(tenantName)) {
tenantName = TenantService.instance().getDefaultTenantName();
}
Tenant tenant = TenantService.instance().getTenant(tenantName);
... | java | private Tenant getTenant(Map<String, String> variableMap) {
String tenantName = variableMap.get("tenant");
if (Utils.isEmpty(tenantName)) {
tenantName = TenantService.instance().getDefaultTenantName();
}
Tenant tenant = TenantService.instance().getTenant(tenantName);
... | [
"private",
"Tenant",
"getTenant",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"variableMap",
")",
"{",
"String",
"tenantName",
"=",
"variableMap",
".",
"get",
"(",
"\"tenant\"",
")",
";",
"if",
"(",
"Utils",
".",
"isEmpty",
"(",
"tenantName",
")",
")"... | Get the Tenant context for this command and multi-tenant configuration options. | [
"Get",
"the",
"Tenant",
"context",
"for",
"this",
"command",
"and",
"multi",
"-",
"tenant",
"configuration",
"options",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java#L214-L224 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java | RESTServlet.validateTenantAccess | private void validateTenantAccess(HttpServletRequest request, Tenant tenant, RegisteredCommand cmdModel) {
String authString = request.getHeader("Authorization");
StringBuilder userID = new StringBuilder();
StringBuilder password = new StringBuilder();
decodeAuthorizationHeader(authS... | java | private void validateTenantAccess(HttpServletRequest request, Tenant tenant, RegisteredCommand cmdModel) {
String authString = request.getHeader("Authorization");
StringBuilder userID = new StringBuilder();
StringBuilder password = new StringBuilder();
decodeAuthorizationHeader(authS... | [
"private",
"void",
"validateTenantAccess",
"(",
"HttpServletRequest",
"request",
",",
"Tenant",
"tenant",
",",
"RegisteredCommand",
"cmdModel",
")",
"{",
"String",
"authString",
"=",
"request",
".",
"getHeader",
"(",
"\"Authorization\"",
")",
";",
"StringBuilder",
"... | Extract Authorization header, if any, and validate this command for the given tenant. | [
"Extract",
"Authorization",
"header",
"if",
"any",
"and",
"validate",
"this",
"command",
"for",
"the",
"given",
"tenant",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java#L227-L235 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java | RESTServlet.permissionForMethod | private Permission permissionForMethod(String method) {
switch (method.toUpperCase()) {
case "GET":
return Permission.READ;
case "PUT":
case "DELETE":
return Permission.UPDATE;
case "POST":
return Permission.APPEND;
default:
... | java | private Permission permissionForMethod(String method) {
switch (method.toUpperCase()) {
case "GET":
return Permission.READ;
case "PUT":
case "DELETE":
return Permission.UPDATE;
case "POST":
return Permission.APPEND;
default:
... | [
"private",
"Permission",
"permissionForMethod",
"(",
"String",
"method",
")",
"{",
"switch",
"(",
"method",
".",
"toUpperCase",
"(",
")",
")",
"{",
"case",
"\"GET\"",
":",
"return",
"Permission",
".",
"READ",
";",
"case",
"\"PUT\"",
":",
"case",
"\"DELETE\""... | Map an HTTP method to the permission needed to execute it. | [
"Map",
"an",
"HTTP",
"method",
"to",
"the",
"permission",
"needed",
"to",
"execute",
"it",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java#L238-L250 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java | RESTServlet.extractQueryParam | private String extractQueryParam(HttpServletRequest request, Map<String, String> restParams) {
String query = request.getQueryString();
if (Utils.isEmpty(query)) {
return "";
}
StringBuilder buffer = new StringBuilder(query);
// Split query component i... | java | private String extractQueryParam(HttpServletRequest request, Map<String, String> restParams) {
String query = request.getQueryString();
if (Utils.isEmpty(query)) {
return "";
}
StringBuilder buffer = new StringBuilder(query);
// Split query component i... | [
"private",
"String",
"extractQueryParam",
"(",
"HttpServletRequest",
"request",
",",
"Map",
"<",
"String",
",",
"String",
">",
"restParams",
")",
"{",
"String",
"query",
"=",
"request",
".",
"getQueryString",
"(",
")",
";",
"if",
"(",
"Utils",
".",
"isEmpty"... | "format=y", and "tenant=z", if present, to rest parameters. | [
"format",
"=",
"y",
"and",
"tenant",
"=",
"z",
"if",
"present",
"to",
"rest",
"parameters",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java#L300-L350 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java | RESTServlet.getFullURI | private String getFullURI(HttpServletRequest request) {
StringBuilder buffer = new StringBuilder(request.getMethod());
buffer.append(" ");
buffer.append(request.getRequestURI());
String queryParam = request.getQueryString();
if (!Utils.isEmpty(queryParam)) {
buf... | java | private String getFullURI(HttpServletRequest request) {
StringBuilder buffer = new StringBuilder(request.getMethod());
buffer.append(" ");
buffer.append(request.getRequestURI());
String queryParam = request.getQueryString();
if (!Utils.isEmpty(queryParam)) {
buf... | [
"private",
"String",
"getFullURI",
"(",
"HttpServletRequest",
"request",
")",
"{",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
"request",
".",
"getMethod",
"(",
")",
")",
";",
"buffer",
".",
"append",
"(",
"\" \"",
")",
";",
"buffer",
".",
... | Reconstruct the entire URI from the given request. | [
"Reconstruct",
"the",
"entire",
"URI",
"from",
"the",
"given",
"request",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/rest/RESTServlet.java#L368-L378 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java | ServerParams.setLegacy | private static void setLegacy(String moduleName, String legacyParamName) {
String oldValue = g_legacyToModuleMap.put(legacyParamName, moduleName);
if (oldValue != null) {
logger.warn("Legacy parameter name used twice: {}", legacyParamName);
}
} | java | private static void setLegacy(String moduleName, String legacyParamName) {
String oldValue = g_legacyToModuleMap.put(legacyParamName, moduleName);
if (oldValue != null) {
logger.warn("Legacy parameter name used twice: {}", legacyParamName);
}
} | [
"private",
"static",
"void",
"setLegacy",
"(",
"String",
"moduleName",
",",
"String",
"legacyParamName",
")",
"{",
"String",
"oldValue",
"=",
"g_legacyToModuleMap",
".",
"put",
"(",
"legacyParamName",
",",
"moduleName",
")",
";",
"if",
"(",
"oldValue",
"!=",
"... | Register the given legacy parameter name as owned by the given module name. | [
"Register",
"the",
"given",
"legacy",
"parameter",
"name",
"as",
"owned",
"by",
"the",
"given",
"module",
"name",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java#L63-L68 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java | ServerParams.setLegacy | private static void setLegacy(String moduleName, String... legacyParamNames) {
for (String legacyParamName : legacyParamNames) {
setLegacy(moduleName, legacyParamName);
}
} | java | private static void setLegacy(String moduleName, String... legacyParamNames) {
for (String legacyParamName : legacyParamNames) {
setLegacy(moduleName, legacyParamName);
}
} | [
"private",
"static",
"void",
"setLegacy",
"(",
"String",
"moduleName",
",",
"String",
"...",
"legacyParamNames",
")",
"{",
"for",
"(",
"String",
"legacyParamName",
":",
"legacyParamNames",
")",
"{",
"setLegacy",
"(",
"moduleName",
",",
"legacyParamName",
")",
";... | Register the given legacy parameter names as owned by the given module name. | [
"Register",
"the",
"given",
"legacy",
"parameter",
"names",
"as",
"owned",
"by",
"the",
"given",
"module",
"name",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java#L71-L75 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java | ServerParams.getConfigUrl | private static URL getConfigUrl() throws ConfigurationException {
String spec = System.getProperty(CONFIG_URL_PROPERTY_NAME);
if (spec == null) {
spec = DEFAULT_CONFIG_URL;
}
URL configUrl = null;
try {
configUrl = new URL(spec);
conf... | java | private static URL getConfigUrl() throws ConfigurationException {
String spec = System.getProperty(CONFIG_URL_PROPERTY_NAME);
if (spec == null) {
spec = DEFAULT_CONFIG_URL;
}
URL configUrl = null;
try {
configUrl = new URL(spec);
conf... | [
"private",
"static",
"URL",
"getConfigUrl",
"(",
")",
"throws",
"ConfigurationException",
"{",
"String",
"spec",
"=",
"System",
".",
"getProperty",
"(",
"CONFIG_URL_PROPERTY_NAME",
")",
";",
"if",
"(",
"spec",
"==",
"null",
")",
"{",
"spec",
"=",
"DEFAULT_CONF... | Inspect the classpath to find configuration file | [
"Inspect",
"the",
"classpath",
"to",
"find",
"configuration",
"file"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java#L435-L465 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java | ServerParams.updateMap | @SuppressWarnings("unchecked")
private void updateMap(Map<String, Object> parentMap, String paramName, Object paramValue) {
Object currentValue = parentMap.get(paramName);
if (currentValue == null || !(currentValue instanceof Map)) {
if (paramValue instanceof Map) {
... | java | @SuppressWarnings("unchecked")
private void updateMap(Map<String, Object> parentMap, String paramName, Object paramValue) {
Object currentValue = parentMap.get(paramName);
if (currentValue == null || !(currentValue instanceof Map)) {
if (paramValue instanceof Map) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"updateMap",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parentMap",
",",
"String",
"paramName",
",",
"Object",
"paramValue",
")",
"{",
"Object",
"currentValue",
"=",
"parentMap",
".",
... | Replace or add the given parameter name and value to the given map. | [
"Replace",
"or",
"add",
"the",
"given",
"parameter",
"name",
"and",
"value",
"to",
"the",
"given",
"map",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java#L501-L519 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java | ServerParams.setLegacyParam | private void setLegacyParam(String legacyParamName, Object paramValue) {
if (!m_bWarnedLegacyParam) {
logger.warn("Parameter '{}': Legacy parameter format is being phased-out. " +
"Please use new module/parameter format.", legacyParamName);
m_bWarnedLegacyPara... | java | private void setLegacyParam(String legacyParamName, Object paramValue) {
if (!m_bWarnedLegacyParam) {
logger.warn("Parameter '{}': Legacy parameter format is being phased-out. " +
"Please use new module/parameter format.", legacyParamName);
m_bWarnedLegacyPara... | [
"private",
"void",
"setLegacyParam",
"(",
"String",
"legacyParamName",
",",
"Object",
"paramValue",
")",
"{",
"if",
"(",
"!",
"m_bWarnedLegacyParam",
")",
"{",
"logger",
".",
"warn",
"(",
"\"Parameter '{}': Legacy parameter format is being phased-out. \"",
"+",
"\"Pleas... | Sets a parameter using a legacy name. | [
"Sets",
"a",
"parameter",
"using",
"a",
"legacy",
"name",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/core/ServerParams.java#L522-L534 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.parse | public void parse(UNode tableNode) {
assert tableNode != null;
// Verify table name and save it.
setTableName(tableNode.getName());
// Examine table node's children.
for (String childName : tableNode.getMemberNames()) {
UNode childNode = tabl... | java | public void parse(UNode tableNode) {
assert tableNode != null;
// Verify table name and save it.
setTableName(tableNode.getName());
// Examine table node's children.
for (String childName : tableNode.getMemberNames()) {
UNode childNode = tabl... | [
"public",
"void",
"parse",
"(",
"UNode",
"tableNode",
")",
"{",
"assert",
"tableNode",
"!=",
"null",
";",
"// Verify table name and save it.\r",
"setTableName",
"(",
"tableNode",
".",
"getName",
"(",
")",
")",
";",
"// Examine table node's children.\r",
"for",
"(",
... | Parse a table definition rooted at the given UNode. The given node is the table
definition, hence its name is the table name. The node must be a MAP whose child
nodes are table definitions such as "options" and "fields".
@param tableNode {@link UNode} whose name is the table's name and whose
child nodes define the tab... | [
"Parse",
"a",
"table",
"definition",
"rooted",
"at",
"the",
"given",
"UNode",
".",
"The",
"given",
"node",
"is",
"the",
"table",
"definition",
"hence",
"its",
"name",
"is",
"the",
"table",
"name",
".",
"The",
"node",
"must",
"be",
"a",
"MAP",
"whose",
... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L132-L185 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.isValidTableName | public static boolean isValidTableName(String tableName) {
return tableName != null &&
tableName.length() > 0 &&
Utils.isLetter(tableName.charAt(0)) &&
Utils.allAlphaNumUnderscore(tableName);
} | java | public static boolean isValidTableName(String tableName) {
return tableName != null &&
tableName.length() > 0 &&
Utils.isLetter(tableName.charAt(0)) &&
Utils.allAlphaNumUnderscore(tableName);
} | [
"public",
"static",
"boolean",
"isValidTableName",
"(",
"String",
"tableName",
")",
"{",
"return",
"tableName",
"!=",
"null",
"&&",
"tableName",
".",
"length",
"(",
")",
">",
"0",
"&&",
"Utils",
".",
"isLetter",
"(",
"tableName",
".",
"charAt",
"(",
"0",
... | Indicate if the given string is a valid table name. Table names must begin with a
letter and consist of all letters, digits, and underscores.
@param tableName Candidate table name.
@return True if the name is not null, not empty, starts with a letter, and
consists of only letters, digits, and underscores. | [
"Indicate",
"if",
"the",
"given",
"string",
"is",
"a",
"valid",
"table",
"name",
".",
"Table",
"names",
"must",
"begin",
"with",
"a",
"letter",
"and",
"consist",
"of",
"all",
"letters",
"digits",
"and",
"underscores",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L195-L200 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.computeShardStart | public Date computeShardStart(int shardNumber) {
assert isSharded();
assert shardNumber > 0;
assert m_shardingStartDate != null;
// Shard #1 always starts on the sharding-start date.
Date result = null;
if (shardNumber == 1) {
result = m_shard... | java | public Date computeShardStart(int shardNumber) {
assert isSharded();
assert shardNumber > 0;
assert m_shardingStartDate != null;
// Shard #1 always starts on the sharding-start date.
Date result = null;
if (shardNumber == 1) {
result = m_shard... | [
"public",
"Date",
"computeShardStart",
"(",
"int",
"shardNumber",
")",
"{",
"assert",
"isSharded",
"(",
")",
";",
"assert",
"shardNumber",
">",
"0",
";",
"assert",
"m_shardingStartDate",
"!=",
"null",
";",
"// Shard #1 always starts on the sharding-start date.\r",
"Da... | Compute and return the date at which the shard with the given number starts based
on this table's sharding options. For example, if sharding-granularity is MONTH
and the sharding-start is 2012-10-15, then shard 2 starts on 2012-11-01.
@param shardNumber Shard number (> 0).
@return Date on which the g... | [
"Compute",
"and",
"return",
"the",
"date",
"at",
"which",
"the",
"shard",
"with",
"the",
"given",
"number",
"starts",
"based",
"on",
"this",
"table",
"s",
"sharding",
"options",
".",
"For",
"example",
"if",
"sharding",
"-",
"granularity",
"is",
"MONTH",
"a... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L213-L253 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.computeShardNumber | public int computeShardNumber(Date shardingFieldValue) {
assert shardingFieldValue != null;
assert isSharded();
assert m_shardingStartDate != null;
// Convert the sharding field value into a calendar object. Note that this value
// will have non-zero time elements.... | java | public int computeShardNumber(Date shardingFieldValue) {
assert shardingFieldValue != null;
assert isSharded();
assert m_shardingStartDate != null;
// Convert the sharding field value into a calendar object. Note that this value
// will have non-zero time elements.... | [
"public",
"int",
"computeShardNumber",
"(",
"Date",
"shardingFieldValue",
")",
"{",
"assert",
"shardingFieldValue",
"!=",
"null",
";",
"assert",
"isSharded",
"(",
")",
";",
"assert",
"m_shardingStartDate",
"!=",
"null",
";",
"// Convert the sharding field value into a c... | Compute the shard number of an object belong to this table with the given
sharding-field value. This method should only be called on a sharded table for
which the sharding-field, sharding-granularity, and sharding-start options have
been set. The value returned will be 0 if the given date falls before the
sharding-star... | [
"Compute",
"the",
"shard",
"number",
"of",
"an",
"object",
"belong",
"to",
"this",
"table",
"with",
"the",
"given",
"sharding",
"-",
"field",
"value",
".",
"This",
"method",
"should",
"only",
"be",
"called",
"on",
"a",
"sharded",
"table",
"for",
"which",
... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L268-L317 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.isCollection | public boolean isCollection(String fieldName) {
FieldDefinition fieldDef = m_fieldDefMap.get(fieldName);
return fieldDef != null && fieldDef.isScalarField() && fieldDef.isCollection();
} | java | public boolean isCollection(String fieldName) {
FieldDefinition fieldDef = m_fieldDefMap.get(fieldName);
return fieldDef != null && fieldDef.isScalarField() && fieldDef.isCollection();
} | [
"public",
"boolean",
"isCollection",
"(",
"String",
"fieldName",
")",
"{",
"FieldDefinition",
"fieldDef",
"=",
"m_fieldDefMap",
".",
"get",
"(",
"fieldName",
")",
";",
"return",
"fieldDef",
"!=",
"null",
"&&",
"fieldDef",
".",
"isScalarField",
"(",
")",
"&&",
... | Return true if the given field name is an MV scalar field. Since scalar fields
must be declared as MV, only predefined fields can be MV.
@param fieldName Candidate field name.
@return True if the name is a known MV scalar field, otherwise false. | [
"Return",
"true",
"if",
"the",
"given",
"field",
"name",
"is",
"an",
"MV",
"scalar",
"field",
".",
"Since",
"scalar",
"fields",
"must",
"be",
"declared",
"as",
"MV",
"only",
"predefined",
"fields",
"can",
"be",
"MV",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L472-L475 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.isLinkField | public boolean isLinkField(String fieldName) {
FieldDefinition fieldDef = m_fieldDefMap.get(fieldName);
return fieldDef != null && fieldDef.isLinkField();
} | java | public boolean isLinkField(String fieldName) {
FieldDefinition fieldDef = m_fieldDefMap.get(fieldName);
return fieldDef != null && fieldDef.isLinkField();
} | [
"public",
"boolean",
"isLinkField",
"(",
"String",
"fieldName",
")",
"{",
"FieldDefinition",
"fieldDef",
"=",
"m_fieldDefMap",
".",
"get",
"(",
"fieldName",
")",
";",
"return",
"fieldDef",
"!=",
"null",
"&&",
"fieldDef",
".",
"isLinkField",
"(",
")",
";",
"}... | Return true if this table definition possesses a FieldDefinition with the given name
that defines a Link field.
@param fieldName Candidate field name.
@return True if the name is a known Link field, otherwise false. | [
"Return",
"true",
"if",
"this",
"table",
"definition",
"possesses",
"a",
"FieldDefinition",
"with",
"the",
"given",
"name",
"that",
"defines",
"a",
"Link",
"field",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L484-L487 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.setOption | public void setOption(String optionName, String optionValue) {
// Ensure option value is not empty and trim excess whitespace.
Utils.require(optionName != null, "optionName");
Utils.require(optionValue != null && optionValue.trim().length() > 0,
"Value for option '" + o... | java | public void setOption(String optionName, String optionValue) {
// Ensure option value is not empty and trim excess whitespace.
Utils.require(optionName != null, "optionName");
Utils.require(optionValue != null && optionValue.trim().length() > 0,
"Value for option '" + o... | [
"public",
"void",
"setOption",
"(",
"String",
"optionName",
",",
"String",
"optionValue",
")",
"{",
"// Ensure option value is not empty and trim excess whitespace.\r",
"Utils",
".",
"require",
"(",
"optionName",
"!=",
"null",
",",
"\"optionName\"",
")",
";",
"Utils",
... | Set the option with the given name to the given value. This method does not
validate that the given option name and value are valid since options are
storage service-specific.
@param optionName Option name. This is down-cased when stored.
@param optionValue Option value. Cannot be null. | [
"Set",
"the",
"option",
"with",
"the",
"given",
"name",
"to",
"the",
"given",
"value",
".",
"This",
"method",
"does",
"not",
"validate",
"that",
"the",
"given",
"option",
"name",
"and",
"value",
"are",
"valid",
"since",
"options",
"are",
"storage",
"servic... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L599-L619 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.getLinkExtentTableDef | public TableDefinition getLinkExtentTableDef(FieldDefinition linkDef) {
assert linkDef != null;
assert linkDef.isLinkType();
assert m_appDef != null;
TableDefinition tableDef = m_appDef.getTableDef(linkDef.getLinkExtent());
assert tableDef != null;
return ... | java | public TableDefinition getLinkExtentTableDef(FieldDefinition linkDef) {
assert linkDef != null;
assert linkDef.isLinkType();
assert m_appDef != null;
TableDefinition tableDef = m_appDef.getTableDef(linkDef.getLinkExtent());
assert tableDef != null;
return ... | [
"public",
"TableDefinition",
"getLinkExtentTableDef",
"(",
"FieldDefinition",
"linkDef",
")",
"{",
"assert",
"linkDef",
"!=",
"null",
";",
"assert",
"linkDef",
".",
"isLinkType",
"(",
")",
";",
"assert",
"m_appDef",
"!=",
"null",
";",
"TableDefinition",
"tableDef"... | Get the TableDefinition of the "extent" table for the given link field.
@param linkDef {@link FieldDefinition} for a link field.
@return {@link TableDefinition} for link's extent (target) table. | [
"Get",
"the",
"TableDefinition",
"of",
"the",
"extent",
"table",
"for",
"the",
"given",
"link",
"field",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L650-L658 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.extractLinkValue | public boolean extractLinkValue(String colName, Map<String, Set<String>> mvLinkValueMap) {
// Link column names always begin with '~'.
if (colName.length() == 0 || colName.charAt(0) != '~') {
return false;
}
// A '/' should separate the field name and object va... | java | public boolean extractLinkValue(String colName, Map<String, Set<String>> mvLinkValueMap) {
// Link column names always begin with '~'.
if (colName.length() == 0 || colName.charAt(0) != '~') {
return false;
}
// A '/' should separate the field name and object va... | [
"public",
"boolean",
"extractLinkValue",
"(",
"String",
"colName",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"mvLinkValueMap",
")",
"{",
"// Link column names always begin with '~'.\r",
"if",
"(",
"colName",
".",
"length",
"(",
")",
"==",
... | Examine the given column name and, if it represents an MV link value, add it to the
given MV link value map. If a link value is successfully extracted, true is returned.
If the column name is not in the format used for MV link values, false is returned.
@param colName Column name from an object record belonging... | [
"Examine",
"the",
"given",
"column",
"name",
"and",
"if",
"it",
"represents",
"an",
"MV",
"link",
"value",
"add",
"it",
"to",
"the",
"given",
"MV",
"link",
"value",
"map",
".",
"If",
"a",
"link",
"value",
"is",
"successfully",
"extracted",
"true",
"is",
... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L672-L697 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.addAliasDefinition | private void addAliasDefinition(AliasDefinition aliasDef) {
// Prerequisites:
assert aliasDef != null;
assert !m_aliasDefMap.containsKey(aliasDef.getName());
assert aliasDef.getTableName().equals(this.getTableName());
m_aliasDefMap.put(aliasDef.getName(), aliasDef)... | java | private void addAliasDefinition(AliasDefinition aliasDef) {
// Prerequisites:
assert aliasDef != null;
assert !m_aliasDefMap.containsKey(aliasDef.getName());
assert aliasDef.getTableName().equals(this.getTableName());
m_aliasDefMap.put(aliasDef.getName(), aliasDef)... | [
"private",
"void",
"addAliasDefinition",
"(",
"AliasDefinition",
"aliasDef",
")",
"{",
"// Prerequisites:\r",
"assert",
"aliasDef",
"!=",
"null",
";",
"assert",
"!",
"m_aliasDefMap",
".",
"containsKey",
"(",
"aliasDef",
".",
"getName",
"(",
")",
")",
";",
"asser... | Add the given alias definition to this table definition. | [
"Add",
"the",
"given",
"alias",
"definition",
"to",
"this",
"table",
"definition",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L775-L782 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java | TableDefinition.verifyJunctionField | private void verifyJunctionField(FieldDefinition xlinkDef) {
String juncField = xlinkDef.getXLinkJunction();
if (!"_ID".equals(juncField)) {
FieldDefinition juncFieldDef = m_fieldDefMap.get(juncField);
Utils.require(juncFieldDef != null,
String.form... | java | private void verifyJunctionField(FieldDefinition xlinkDef) {
String juncField = xlinkDef.getXLinkJunction();
if (!"_ID".equals(juncField)) {
FieldDefinition juncFieldDef = m_fieldDefMap.get(juncField);
Utils.require(juncFieldDef != null,
String.form... | [
"private",
"void",
"verifyJunctionField",
"(",
"FieldDefinition",
"xlinkDef",
")",
"{",
"String",
"juncField",
"=",
"xlinkDef",
".",
"getXLinkJunction",
"(",
")",
";",
"if",
"(",
"!",
"\"_ID\"",
".",
"equals",
"(",
"juncField",
")",
")",
"{",
"FieldDefinition"... | Verify that the given xlink's junction field is either _ID or an SV text field. | [
"Verify",
"that",
"the",
"given",
"xlink",
"s",
"junction",
"field",
"is",
"either",
"_ID",
"or",
"an",
"SV",
"text",
"field",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TableDefinition.java#L806-L817 | train |
QSFT/Doradus | doradus-dynamodb/src/main/java/com/dell/doradus/db/dynamodb/DDBTransaction.java | DDBTransaction.mapColumnValue | private AttributeValue mapColumnValue(String storeName, DColumn col) {
AttributeValue attrValue = new AttributeValue();
if (!DBService.isSystemTable(storeName)) {
if (col.getRawValue().length == 0) {
attrValue.setS(DynamoDBService.NULL_COLUMN_MARKER);
} else {
... | java | private AttributeValue mapColumnValue(String storeName, DColumn col) {
AttributeValue attrValue = new AttributeValue();
if (!DBService.isSystemTable(storeName)) {
if (col.getRawValue().length == 0) {
attrValue.setS(DynamoDBService.NULL_COLUMN_MARKER);
} else {
... | [
"private",
"AttributeValue",
"mapColumnValue",
"(",
"String",
"storeName",
",",
"DColumn",
"col",
")",
"{",
"AttributeValue",
"attrValue",
"=",
"new",
"AttributeValue",
"(",
")",
";",
"if",
"(",
"!",
"DBService",
".",
"isSystemTable",
"(",
"storeName",
")",
")... | Create the appropriate AttributeValue for the given column value type and length. | [
"Create",
"the",
"appropriate",
"AttributeValue",
"for",
"the",
"given",
"column",
"value",
"type",
"and",
"length",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-dynamodb/src/main/java/com/dell/doradus/db/dynamodb/DDBTransaction.java#L120-L136 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/fieldanalyzer/FieldAnalyzer.java | FieldAnalyzer.extractTerms | public Set<String> extractTerms(String value) {
try {
Set<String> result = new HashSet<String>();
Set<String> split = Utils.split(value.toLowerCase(), CommonDefs.MV_SCALAR_SEP_CHAR);
for(String s : split) {
String[] tokens = tokenize(s);
for (String token : tokens) {
... | java | public Set<String> extractTerms(String value) {
try {
Set<String> result = new HashSet<String>();
Set<String> split = Utils.split(value.toLowerCase(), CommonDefs.MV_SCALAR_SEP_CHAR);
for(String s : split) {
String[] tokens = tokenize(s);
for (String token : tokens) {
... | [
"public",
"Set",
"<",
"String",
">",
"extractTerms",
"(",
"String",
"value",
")",
"{",
"try",
"{",
"Set",
"<",
"String",
">",
"result",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"Set",
"<",
"String",
">",
"split",
"=",
"Utils",
".",... | Analyze the given String value and return the set of terms that should be indexed.
@param value Field value to be indexed as a binary value.
@return Set of terms that should be indexed. | [
"Analyze",
"the",
"given",
"String",
"value",
"and",
"return",
"the",
"set",
"of",
"terms",
"that",
"should",
"be",
"indexed",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/fieldanalyzer/FieldAnalyzer.java#L198-L214 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/BatchResult.java | BatchResult.newErrorResult | public static BatchResult newErrorResult(String errMsg) {
BatchResult result = new BatchResult();
result.setStatus(Status.ERROR);
result.setErrorMessage(errMsg);
return result;
} | java | public static BatchResult newErrorResult(String errMsg) {
BatchResult result = new BatchResult();
result.setStatus(Status.ERROR);
result.setErrorMessage(errMsg);
return result;
} | [
"public",
"static",
"BatchResult",
"newErrorResult",
"(",
"String",
"errMsg",
")",
"{",
"BatchResult",
"result",
"=",
"new",
"BatchResult",
"(",
")",
";",
"result",
".",
"setStatus",
"(",
"Status",
".",
"ERROR",
")",
";",
"result",
".",
"setErrorMessage",
"(... | Create a new BatchResult with an ERROR status and the given error message.
@param errMsg Error message.
@return New BatchResult object with ERROR status and given error message. | [
"Create",
"a",
"new",
"BatchResult",
"with",
"an",
"ERROR",
"status",
"and",
"the",
"given",
"error",
"message",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/BatchResult.java#L50-L55 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/BatchResult.java | BatchResult.hasUpdates | public boolean hasUpdates() {
String hasUpdates = m_resultFields.get(HAS_UPDATES);
return hasUpdates != null && Boolean.parseBoolean(hasUpdates);
} | java | public boolean hasUpdates() {
String hasUpdates = m_resultFields.get(HAS_UPDATES);
return hasUpdates != null && Boolean.parseBoolean(hasUpdates);
} | [
"public",
"boolean",
"hasUpdates",
"(",
")",
"{",
"String",
"hasUpdates",
"=",
"m_resultFields",
".",
"get",
"(",
"HAS_UPDATES",
")",
";",
"return",
"hasUpdates",
"!=",
"null",
"&&",
"Boolean",
".",
"parseBoolean",
"(",
"hasUpdates",
")",
";",
"}"
] | Return true if this batch result has at least one object that was updated.
@return True if at least one object was updated by the batch that created this
result. | [
"Return",
"true",
"if",
"this",
"batch",
"result",
"has",
"at",
"least",
"one",
"object",
"that",
"was",
"updated",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/BatchResult.java#L255-L258 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/BatchResult.java | BatchResult.toDoc | public UNode toDoc() {
// Root node is map with 1 child per result field and optionally "docs".
UNode result = UNode.createMapNode("batch-result");
for (String fieldName : m_resultFields.keySet()) {
result.addValueNode(fieldName, m_resultFields.get(fieldName));
}
... | java | public UNode toDoc() {
// Root node is map with 1 child per result field and optionally "docs".
UNode result = UNode.createMapNode("batch-result");
for (String fieldName : m_resultFields.keySet()) {
result.addValueNode(fieldName, m_resultFields.get(fieldName));
}
... | [
"public",
"UNode",
"toDoc",
"(",
")",
"{",
"// Root node is map with 1 child per result field and optionally \"docs\".\r",
"UNode",
"result",
"=",
"UNode",
".",
"createMapNode",
"(",
"\"batch-result\"",
")",
";",
"for",
"(",
"String",
"fieldName",
":",
"m_resultFields",
... | Serialize this BatchResult result into a UNode tree. The root node is called
"batch-result".
@return This object serialized into a UNode tree. | [
"Serialize",
"this",
"BatchResult",
"result",
"into",
"a",
"UNode",
"tree",
".",
"The",
"root",
"node",
"is",
"called",
"batch",
"-",
"result",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/BatchResult.java#L276-L289 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.registerTaskStarted | void registerTaskStarted(Task task) {
synchronized (m_activeTasks) {
String mapKey = createMapKey(task.getTenant(), task.getTaskID());
if (m_activeTasks.put(mapKey, task) != null) {
m_logger.warn("Task {} registered as started but was already running", mapKey);
... | java | void registerTaskStarted(Task task) {
synchronized (m_activeTasks) {
String mapKey = createMapKey(task.getTenant(), task.getTaskID());
if (m_activeTasks.put(mapKey, task) != null) {
m_logger.warn("Task {} registered as started but was already running", mapKey);
... | [
"void",
"registerTaskStarted",
"(",
"Task",
"task",
")",
"{",
"synchronized",
"(",
"m_activeTasks",
")",
"{",
"String",
"mapKey",
"=",
"createMapKey",
"(",
"task",
".",
"getTenant",
"(",
")",
",",
"task",
".",
"getTaskID",
"(",
")",
")",
";",
"if",
"(",
... | Called by a Task when it's thread starts. This lets the task manager know
which tasks are its own.
@param task {@link Task} that is executing task. | [
"Called",
"by",
"a",
"Task",
"when",
"it",
"s",
"thread",
"starts",
".",
"This",
"lets",
"the",
"task",
"manager",
"know",
"which",
"tasks",
"are",
"its",
"own",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L206-L213 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.registerTaskEnded | void registerTaskEnded(Task task) {
synchronized (m_activeTasks) {
String mapKey = createMapKey(task.getTenant(), task.getTaskID());
if (m_activeTasks.remove(mapKey) == null) {
m_logger.warn("Task {} registered as ended but was not running", mapKey);
}
... | java | void registerTaskEnded(Task task) {
synchronized (m_activeTasks) {
String mapKey = createMapKey(task.getTenant(), task.getTaskID());
if (m_activeTasks.remove(mapKey) == null) {
m_logger.warn("Task {} registered as ended but was not running", mapKey);
}
... | [
"void",
"registerTaskEnded",
"(",
"Task",
"task",
")",
"{",
"synchronized",
"(",
"m_activeTasks",
")",
"{",
"String",
"mapKey",
"=",
"createMapKey",
"(",
"task",
".",
"getTenant",
"(",
")",
",",
"task",
".",
"getTaskID",
"(",
")",
")",
";",
"if",
"(",
... | Called by a Task when it's thread finishes. This lets the task manager know
that another slot has opened-up.
@param task {@link Task} that just finished. | [
"Called",
"by",
"a",
"Task",
"when",
"it",
"s",
"thread",
"finishes",
".",
"This",
"lets",
"the",
"task",
"manager",
"know",
"that",
"another",
"slot",
"has",
"opened",
"-",
"up",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L221-L228 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.updateTaskStatus | void updateTaskStatus(Tenant tenant, TaskRecord taskRecord, boolean bDeleteClaimRecord) {
String taskID = taskRecord.getTaskID();
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
Map<String, String> propMap = taskRecord.getProperties();
for (String name : propMap.key... | java | void updateTaskStatus(Tenant tenant, TaskRecord taskRecord, boolean bDeleteClaimRecord) {
String taskID = taskRecord.getTaskID();
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
Map<String, String> propMap = taskRecord.getProperties();
for (String name : propMap.key... | [
"void",
"updateTaskStatus",
"(",
"Tenant",
"tenant",
",",
"TaskRecord",
"taskRecord",
",",
"boolean",
"bDeleteClaimRecord",
")",
"{",
"String",
"taskID",
"=",
"taskRecord",
".",
"getTaskID",
"(",
")",
";",
"DBTransaction",
"dbTran",
"=",
"DBService",
".",
"insta... | Add or update a task status record and optionally delete the task's claim record at
the same time.
@param tenant {@link Tenant} that owns the task's application.
@param taskRecord {@link TaskRecord} containing task properties to be
written to the database. A null/empty property value
causes t... | [
"Add",
"or",
"update",
"a",
"task",
"status",
"record",
"and",
"optionally",
"delete",
"the",
"task",
"s",
"claim",
"record",
"at",
"the",
"same",
"time",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L263-L279 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.waitForTaskStatus | private TaskRecord waitForTaskStatus(Tenant tenant, Task task, Predicate<TaskStatus> pred) {
TaskRecord taskRecord = null;
while (true) {
Iterator<DColumn> colIter =
DBService.instance(tenant).getAllColumns(TaskManagerService.TASKS_STORE_NAME, task.getTaskID()).iterator();
... | java | private TaskRecord waitForTaskStatus(Tenant tenant, Task task, Predicate<TaskStatus> pred) {
TaskRecord taskRecord = null;
while (true) {
Iterator<DColumn> colIter =
DBService.instance(tenant).getAllColumns(TaskManagerService.TASKS_STORE_NAME, task.getTaskID()).iterator();
... | [
"private",
"TaskRecord",
"waitForTaskStatus",
"(",
"Tenant",
"tenant",
",",
"Task",
"task",
",",
"Predicate",
"<",
"TaskStatus",
">",
"pred",
")",
"{",
"TaskRecord",
"taskRecord",
"=",
"null",
";",
"while",
"(",
"true",
")",
"{",
"Iterator",
"<",
"DColumn",
... | latest status record. If it has never run, a never-run task record is stored. | [
"latest",
"status",
"record",
".",
"If",
"it",
"has",
"never",
"run",
"a",
"never",
"-",
"run",
"task",
"record",
"is",
"stored",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L285-L301 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.manageTasks | private void manageTasks() {
setHostAddress();
while (!m_bShutdown) {
checkAllTasks();
checkForDeadTasks();
try {
Thread.sleep(SLEEP_TIME_MILLIS);
} catch (InterruptedException e) {
}
}
m_executor.shutdown();
... | java | private void manageTasks() {
setHostAddress();
while (!m_bShutdown) {
checkAllTasks();
checkForDeadTasks();
try {
Thread.sleep(SLEEP_TIME_MILLIS);
} catch (InterruptedException e) {
}
}
m_executor.shutdown();
... | [
"private",
"void",
"manageTasks",
"(",
")",
"{",
"setHostAddress",
"(",
")",
";",
"while",
"(",
"!",
"m_bShutdown",
")",
"{",
"checkAllTasks",
"(",
")",
";",
"checkForDeadTasks",
"(",
")",
";",
"try",
"{",
"Thread",
".",
"sleep",
"(",
"SLEEP_TIME_MILLIS",
... | tasks we can run. Shutdown when told to do so. | [
"tasks",
"we",
"can",
"run",
".",
"Shutdown",
"when",
"told",
"to",
"do",
"so",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L305-L316 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.checkTenantTasks | private void checkTenantTasks(Tenant tenant) {
m_logger.debug("Checking tenant '{}' for needy tasks", tenant);
try {
for (ApplicationDefinition appDef : SchemaService.instance().getAllApplications(tenant)) {
for (Task task : getAppTasks(appDef)) {
checkTas... | java | private void checkTenantTasks(Tenant tenant) {
m_logger.debug("Checking tenant '{}' for needy tasks", tenant);
try {
for (ApplicationDefinition appDef : SchemaService.instance().getAllApplications(tenant)) {
for (Task task : getAppTasks(appDef)) {
checkTas... | [
"private",
"void",
"checkTenantTasks",
"(",
"Tenant",
"tenant",
")",
"{",
"m_logger",
".",
"debug",
"(",
"\"Checking tenant '{}' for needy tasks\"",
",",
"tenant",
")",
";",
"try",
"{",
"for",
"(",
"ApplicationDefinition",
"appDef",
":",
"SchemaService",
".",
"ins... | Check the given tenant for tasks that need execution. | [
"Check",
"the",
"given",
"tenant",
"for",
"tasks",
"that",
"need",
"execution",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L329-L340 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.checkTaskForExecution | private void checkTaskForExecution(ApplicationDefinition appDef, Task task) {
Tenant tenant = Tenant.getTenant(appDef);
m_logger.debug("Checking task '{}' in tenant '{}'", task.getTaskID(), tenant);
synchronized (m_executeLock) {
Iterator<DColumn> colIter =
DBService.... | java | private void checkTaskForExecution(ApplicationDefinition appDef, Task task) {
Tenant tenant = Tenant.getTenant(appDef);
m_logger.debug("Checking task '{}' in tenant '{}'", task.getTaskID(), tenant);
synchronized (m_executeLock) {
Iterator<DColumn> colIter =
DBService.... | [
"private",
"void",
"checkTaskForExecution",
"(",
"ApplicationDefinition",
"appDef",
",",
"Task",
"task",
")",
"{",
"Tenant",
"tenant",
"=",
"Tenant",
".",
"getTenant",
"(",
"appDef",
")",
";",
"m_logger",
".",
"debug",
"(",
"\"Checking task '{}' in tenant '{}'\"",
... | Check the given task to see if we should and can execute it. | [
"Check",
"the",
"given",
"task",
"to",
"see",
"if",
"we",
"should",
"and",
"can",
"execute",
"it",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L343-L359 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.