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-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.attemptToExecuteTask | private void attemptToExecuteTask(ApplicationDefinition appDef, Task task, TaskRecord taskRecord) {
Tenant tenant = Tenant.getTenant(appDef);
String taskID = taskRecord.getTaskID();
String claimID = "_claim/" + taskID;
long claimStamp = System.currentTimeMillis();
writeTaskClaim(... | java | private void attemptToExecuteTask(ApplicationDefinition appDef, Task task, TaskRecord taskRecord) {
Tenant tenant = Tenant.getTenant(appDef);
String taskID = taskRecord.getTaskID();
String claimID = "_claim/" + taskID;
long claimStamp = System.currentTimeMillis();
writeTaskClaim(... | [
"private",
"void",
"attemptToExecuteTask",
"(",
"ApplicationDefinition",
"appDef",
",",
"Task",
"task",
",",
"TaskRecord",
"taskRecord",
")",
"{",
"Tenant",
"tenant",
"=",
"Tenant",
".",
"getTenant",
"(",
"appDef",
")",
";",
"String",
"taskID",
"=",
"taskRecord"... | Attempt to start the given task by creating claim and see if we win it. | [
"Attempt",
"to",
"start",
"the",
"given",
"task",
"by",
"creating",
"claim",
"and",
"see",
"if",
"we",
"win",
"it",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L398-L409 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.startTask | private void startTask(ApplicationDefinition appDef, Task task, TaskRecord taskRecord) {
try {
task.setParams(m_localHost, taskRecord);
m_executor.execute(task);
} catch (Exception e) {
m_logger.error("Failed to start task '" + task.getTaskID() + "'", e);
}
... | java | private void startTask(ApplicationDefinition appDef, Task task, TaskRecord taskRecord) {
try {
task.setParams(m_localHost, taskRecord);
m_executor.execute(task);
} catch (Exception e) {
m_logger.error("Failed to start task '" + task.getTaskID() + "'", e);
}
... | [
"private",
"void",
"startTask",
"(",
"ApplicationDefinition",
"appDef",
",",
"Task",
"task",
",",
"TaskRecord",
"taskRecord",
")",
"{",
"try",
"{",
"task",
".",
"setParams",
"(",
"m_localHost",
",",
"taskRecord",
")",
";",
"m_executor",
".",
"execute",
"(",
... | Execute the given task by handing it to the ExecutorService. | [
"Execute",
"the",
"given",
"task",
"by",
"handing",
"it",
"to",
"the",
"ExecutorService",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L412-L419 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.taskClaimedByUs | private boolean taskClaimedByUs(Tenant tenant, String claimID) {
waitForClaim();
Iterator<DColumn> colIter =
DBService.instance(tenant).getAllColumns(TaskManagerService.TASKS_STORE_NAME, claimID).iterator();
if (colIter == null) {
m_logger.warn("Claim record disappeared: ... | java | private boolean taskClaimedByUs(Tenant tenant, String claimID) {
waitForClaim();
Iterator<DColumn> colIter =
DBService.instance(tenant).getAllColumns(TaskManagerService.TASKS_STORE_NAME, claimID).iterator();
if (colIter == null) {
m_logger.warn("Claim record disappeared: ... | [
"private",
"boolean",
"taskClaimedByUs",
"(",
"Tenant",
"tenant",
",",
"String",
"claimID",
")",
"{",
"waitForClaim",
"(",
")",
";",
"Iterator",
"<",
"DColumn",
">",
"colIter",
"=",
"DBService",
".",
"instance",
"(",
"tenant",
")",
".",
"getAllColumns",
"(",... | Indicate if we won the claim to run the given task. | [
"Indicate",
"if",
"we",
"won",
"the",
"claim",
"to",
"run",
"the",
"given",
"task",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L422-L456 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.writeTaskClaim | private void writeTaskClaim(Tenant tenant, String claimID, long claimStamp) {
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
dbTran.addColumn(TaskManagerService.TASKS_STORE_NAME, claimID, m_hostClaimID, claimStamp);
DBService.instance(tenant).commit(dbTran);
} | java | private void writeTaskClaim(Tenant tenant, String claimID, long claimStamp) {
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
dbTran.addColumn(TaskManagerService.TASKS_STORE_NAME, claimID, m_hostClaimID, claimStamp);
DBService.instance(tenant).commit(dbTran);
} | [
"private",
"void",
"writeTaskClaim",
"(",
"Tenant",
"tenant",
",",
"String",
"claimID",
",",
"long",
"claimStamp",
")",
"{",
"DBTransaction",
"dbTran",
"=",
"DBService",
".",
"instance",
"(",
"tenant",
")",
".",
"startTransaction",
"(",
")",
";",
"dbTran",
"... | Write a claim record to the Tasks table. | [
"Write",
"a",
"claim",
"record",
"to",
"the",
"Tasks",
"table",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L467-L471 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.buildTaskRecord | private TaskRecord buildTaskRecord(String taskID, Iterator<DColumn> colIter) {
TaskRecord taskRecord = new TaskRecord(taskID);
while (colIter.hasNext()) {
DColumn col = colIter.next();
taskRecord.setProperty(col.getName(), col.getValue());
}
return taskRecord;
... | java | private TaskRecord buildTaskRecord(String taskID, Iterator<DColumn> colIter) {
TaskRecord taskRecord = new TaskRecord(taskID);
while (colIter.hasNext()) {
DColumn col = colIter.next();
taskRecord.setProperty(col.getName(), col.getValue());
}
return taskRecord;
... | [
"private",
"TaskRecord",
"buildTaskRecord",
"(",
"String",
"taskID",
",",
"Iterator",
"<",
"DColumn",
">",
"colIter",
")",
"{",
"TaskRecord",
"taskRecord",
"=",
"new",
"TaskRecord",
"(",
"taskID",
")",
";",
"while",
"(",
"colIter",
".",
"hasNext",
"(",
")",
... | Create a TaskRecord from a task status row read from the Tasks table. | [
"Create",
"a",
"TaskRecord",
"from",
"a",
"task",
"status",
"row",
"read",
"from",
"the",
"Tasks",
"table",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L474-L481 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.storeTaskRecord | private TaskRecord storeTaskRecord(Tenant tenant, Task task) {
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
TaskRecord taskRecord = new TaskRecord(task.getTaskID());
Map<String, String> propMap = taskRecord.getProperties();
assert propMap.size() > 0 : "Need at le... | java | private TaskRecord storeTaskRecord(Tenant tenant, Task task) {
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
TaskRecord taskRecord = new TaskRecord(task.getTaskID());
Map<String, String> propMap = taskRecord.getProperties();
assert propMap.size() > 0 : "Need at le... | [
"private",
"TaskRecord",
"storeTaskRecord",
"(",
"Tenant",
"tenant",
",",
"Task",
"task",
")",
"{",
"DBTransaction",
"dbTran",
"=",
"DBService",
".",
"instance",
"(",
"tenant",
")",
".",
"startTransaction",
"(",
")",
";",
"TaskRecord",
"taskRecord",
"=",
"new"... | Create a TaskRecord for the given task and write it to the Tasks table. | [
"Create",
"a",
"TaskRecord",
"for",
"the",
"given",
"task",
"and",
"write",
"it",
"to",
"the",
"Tasks",
"table",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L484-L494 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.getAppTasks | private List<Task> getAppTasks(ApplicationDefinition appDef) {
List<Task> appTasks = new ArrayList<>();
try {
StorageService service = SchemaService.instance().getStorageService(appDef);
Collection<Task> appTaskColl = service.getAppTasks(appDef);
if (appTaskColl != nu... | java | private List<Task> getAppTasks(ApplicationDefinition appDef) {
List<Task> appTasks = new ArrayList<>();
try {
StorageService service = SchemaService.instance().getStorageService(appDef);
Collection<Task> appTaskColl = service.getAppTasks(appDef);
if (appTaskColl != nu... | [
"private",
"List",
"<",
"Task",
">",
"getAppTasks",
"(",
"ApplicationDefinition",
"appDef",
")",
"{",
"List",
"<",
"Task",
">",
"appTasks",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"StorageService",
"service",
"=",
"SchemaService",
".",
"i... | Ask the storage manager for the given application for its required tasks. | [
"Ask",
"the",
"storage",
"manager",
"for",
"the",
"given",
"application",
"for",
"its",
"required",
"tasks",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L497-L509 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.checkForDeadTask | private void checkForDeadTask(Tenant tenant, TaskRecord taskRecord) {
Calendar lastReport = taskRecord.getTime(TaskRecord.PROP_PROGRESS_TIME);
if (lastReport == null) {
lastReport = taskRecord.getTime(TaskRecord.PROP_START_TIME);
if (lastReport == null) {
return; ... | java | private void checkForDeadTask(Tenant tenant, TaskRecord taskRecord) {
Calendar lastReport = taskRecord.getTime(TaskRecord.PROP_PROGRESS_TIME);
if (lastReport == null) {
lastReport = taskRecord.getTime(TaskRecord.PROP_START_TIME);
if (lastReport == null) {
return; ... | [
"private",
"void",
"checkForDeadTask",
"(",
"Tenant",
"tenant",
",",
"TaskRecord",
"taskRecord",
")",
"{",
"Calendar",
"lastReport",
"=",
"taskRecord",
".",
"getTime",
"(",
"TaskRecord",
".",
"PROP_PROGRESS_TIME",
")",
";",
"if",
"(",
"lastReport",
"==",
"null",... | See if the given in-progress task may be hung or abandoned. | [
"See",
"if",
"the",
"given",
"in",
"-",
"progress",
"task",
"may",
"be",
"hung",
"or",
"abandoned",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L537-L551 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.checkForHungTask | private void checkForHungTask(Tenant tenant, TaskRecord taskRecord, long minsSinceLastActivity) {
if (minsSinceLastActivity > HUNG_TASK_THRESHOLD_MINS) {
String taskIdentity = createMapKey(tenant, taskRecord.getTaskID());
String reason = "No progress reported in " + minsSinceLastActivity... | java | private void checkForHungTask(Tenant tenant, TaskRecord taskRecord, long minsSinceLastActivity) {
if (minsSinceLastActivity > HUNG_TASK_THRESHOLD_MINS) {
String taskIdentity = createMapKey(tenant, taskRecord.getTaskID());
String reason = "No progress reported in " + minsSinceLastActivity... | [
"private",
"void",
"checkForHungTask",
"(",
"Tenant",
"tenant",
",",
"TaskRecord",
"taskRecord",
",",
"long",
"minsSinceLastActivity",
")",
"{",
"if",
"(",
"minsSinceLastActivity",
">",
"HUNG_TASK_THRESHOLD_MINS",
")",
"{",
"String",
"taskIdentity",
"=",
"createMapKey... | potentially harmful second task execution. | [
"potentially",
"harmful",
"second",
"task",
"execution",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L557-L568 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.checkForAbandonedTask | private void checkForAbandonedTask(Tenant tenant, TaskRecord taskRecord, long minsSinceLastActivity) {
if (minsSinceLastActivity > DEAD_TASK_THRESHOLD_MINS) {
String taskIdentity = createMapKey(tenant, taskRecord.getTaskID());
String reason = "No progress reported in " + minsSinceLastAct... | java | private void checkForAbandonedTask(Tenant tenant, TaskRecord taskRecord, long minsSinceLastActivity) {
if (minsSinceLastActivity > DEAD_TASK_THRESHOLD_MINS) {
String taskIdentity = createMapKey(tenant, taskRecord.getTaskID());
String reason = "No progress reported in " + minsSinceLastAct... | [
"private",
"void",
"checkForAbandonedTask",
"(",
"Tenant",
"tenant",
",",
"TaskRecord",
"taskRecord",
",",
"long",
"minsSinceLastActivity",
")",
"{",
"if",
"(",
"minsSinceLastActivity",
">",
"DEAD_TASK_THRESHOLD_MINS",
")",
"{",
"String",
"taskIdentity",
"=",
"createM... | to restart upon the next check-tasks cycle. | [
"to",
"restart",
"upon",
"the",
"next",
"check",
"-",
"tasks",
"cycle",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L573-L584 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.isOurActiveTask | private boolean isOurActiveTask(Tenant tenant, String taskID) {
synchronized (m_activeTasks) {
return m_activeTasks.containsKey(createMapKey(tenant, taskID));
}
} | java | private boolean isOurActiveTask(Tenant tenant, String taskID) {
synchronized (m_activeTasks) {
return m_activeTasks.containsKey(createMapKey(tenant, taskID));
}
} | [
"private",
"boolean",
"isOurActiveTask",
"(",
"Tenant",
"tenant",
",",
"String",
"taskID",
")",
"{",
"synchronized",
"(",
"m_activeTasks",
")",
"{",
"return",
"m_activeTasks",
".",
"containsKey",
"(",
"createMapKey",
"(",
"tenant",
",",
"taskID",
")",
")",
";"... | Return true if we are currently executing the given task. | [
"Return",
"true",
"if",
"we",
"are",
"currently",
"executing",
"the",
"given",
"task",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L592-L596 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java | BatchObjectUpdater.commitTransaction | private void commitTransaction() {
Tenant tenant = Tenant.getTenant(m_tableDef);
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
m_parentTran.applyUpdates(dbTran);
DBService.instance(tenant).commit(dbTran);
m_parentTran.clear();
} | java | private void commitTransaction() {
Tenant tenant = Tenant.getTenant(m_tableDef);
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
m_parentTran.applyUpdates(dbTran);
DBService.instance(tenant).commit(dbTran);
m_parentTran.clear();
} | [
"private",
"void",
"commitTransaction",
"(",
")",
"{",
"Tenant",
"tenant",
"=",
"Tenant",
".",
"getTenant",
"(",
"m_tableDef",
")",
";",
"DBTransaction",
"dbTran",
"=",
"DBService",
".",
"instance",
"(",
"tenant",
")",
".",
"startTransaction",
"(",
")",
";",... | Post all updates in the parent transaction to the database. | [
"Post",
"all",
"updates",
"in",
"the",
"parent",
"transaction",
"to",
"the",
"database",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java#L150-L156 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java | BatchObjectUpdater.updateBatch | private boolean updateBatch(DBObjectBatch dbObjBatch, BatchResult batchResult) throws IOException {
Map<String, Map<String, String>> objCurrScalarMap = getCurrentScalars(dbObjBatch);
Map<String, Map<String, Integer>> targObjShardNos = getLinkTargetShardNumbers(dbObjBatch);
for (DBObject dbObj... | java | private boolean updateBatch(DBObjectBatch dbObjBatch, BatchResult batchResult) throws IOException {
Map<String, Map<String, String>> objCurrScalarMap = getCurrentScalars(dbObjBatch);
Map<String, Map<String, Integer>> targObjShardNos = getLinkTargetShardNumbers(dbObjBatch);
for (DBObject dbObj... | [
"private",
"boolean",
"updateBatch",
"(",
"DBObjectBatch",
"dbObjBatch",
",",
"BatchResult",
"batchResult",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"objCurrScalarMap",
"=",
"getCurrentScalars",
... | Update each object in the given batch, updating BatchResult accordingly. | [
"Update",
"each",
"object",
"in",
"the",
"given",
"batch",
"updating",
"BatchResult",
"accordingly",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java#L174-L185 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java | BatchObjectUpdater.updateObject | private ObjectResult updateObject(DBObject dbObj,
Map<String, String> currScalarMap,
Map<String, Map<String, Integer>> targObjShardNos) {
ObjectResult objResult = null;
if (Utils.isEmpt... | java | private ObjectResult updateObject(DBObject dbObj,
Map<String, String> currScalarMap,
Map<String, Map<String, Integer>> targObjShardNos) {
ObjectResult objResult = null;
if (Utils.isEmpt... | [
"private",
"ObjectResult",
"updateObject",
"(",
"DBObject",
"dbObj",
",",
"Map",
"<",
"String",
",",
"String",
">",
"currScalarMap",
",",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
">",
"targObjShardNos",
")",
"{",
"ObjectResult",
... | Update the given object, which must exist, using the given set of current scalar values. | [
"Update",
"the",
"given",
"object",
"which",
"must",
"exist",
"using",
"the",
"given",
"set",
"of",
"current",
"scalar",
"values",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java#L188-L204 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java | BatchObjectUpdater.addOrUpdateObject | private ObjectResult addOrUpdateObject(DBObject dbObj,
Map<String, String> currScalarMap,
Map<String, Map<String, Integer>> targObjShardNos)
throws IOException {
ObjectUpd... | java | private ObjectResult addOrUpdateObject(DBObject dbObj,
Map<String, String> currScalarMap,
Map<String, Map<String, Integer>> targObjShardNos)
throws IOException {
ObjectUpd... | [
"private",
"ObjectResult",
"addOrUpdateObject",
"(",
"DBObject",
"dbObj",
",",
"Map",
"<",
"String",
",",
"String",
">",
"currScalarMap",
",",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
">",
"targObjShardNos",
")",
"throws",
"IOExc... | Add the given object if its current-value map is null, otherwise update the object. | [
"Add",
"the",
"given",
"object",
"if",
"its",
"current",
"-",
"value",
"map",
"is",
"null",
"otherwise",
"update",
"the",
"object",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java#L207-L220 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java | BatchObjectUpdater.buildErrorStatus | private void buildErrorStatus(BatchResult result, Throwable ex) {
result.setStatus(BatchResult.Status.ERROR);
result.setErrorMessage(ex.getLocalizedMessage());
if (ex instanceof IllegalArgumentException) {
m_logger.debug("Batch update error: {}", ex.toString());
} else {... | java | private void buildErrorStatus(BatchResult result, Throwable ex) {
result.setStatus(BatchResult.Status.ERROR);
result.setErrorMessage(ex.getLocalizedMessage());
if (ex instanceof IllegalArgumentException) {
m_logger.debug("Batch update error: {}", ex.toString());
} else {... | [
"private",
"void",
"buildErrorStatus",
"(",
"BatchResult",
"result",
",",
"Throwable",
"ex",
")",
"{",
"result",
".",
"setStatus",
"(",
"BatchResult",
".",
"Status",
".",
"ERROR",
")",
";",
"result",
".",
"setErrorMessage",
"(",
"ex",
".",
"getLocalizedMessage... | Add error fields to the given BatchResult due to the given exception. | [
"Add",
"error",
"fields",
"to",
"the",
"given",
"BatchResult",
"due",
"to",
"the",
"given",
"exception",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java#L223-L233 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java | BatchObjectUpdater.getCurrentScalars | private Map<String, Map<String, String>> getCurrentScalars(DBObjectBatch dbObjBatch) throws IOException {
Set<String> objIDSet = new HashSet<>();
Set<String> fieldNameSet = new HashSet<String>();
for (DBObject dbObj : dbObjBatch.getObjects()) {
if (!Utils.isEmpty(dbObj.getObjectI... | java | private Map<String, Map<String, String>> getCurrentScalars(DBObjectBatch dbObjBatch) throws IOException {
Set<String> objIDSet = new HashSet<>();
Set<String> fieldNameSet = new HashSet<String>();
for (DBObject dbObj : dbObjBatch.getObjects()) {
if (!Utils.isEmpty(dbObj.getObjectI... | [
"private",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"getCurrentScalars",
"(",
"DBObjectBatch",
"dbObjBatch",
")",
"throws",
"IOException",
"{",
"Set",
"<",
"String",
">",
"objIDSet",
"=",
"new",
"HashSet",
"<>",
"(",
")",
... | Watch and complain about updates to the same ID. | [
"Watch",
"and",
"complain",
"about",
"updates",
"to",
"the",
"same",
"ID",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java#L244-L258 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java | BatchObjectUpdater.getLinkTargetShardNumbers | private Map<String, Map<String, Integer>> getLinkTargetShardNumbers(DBObjectBatch dbObjBatch) {
Map<String, Map<String, Integer>> result = new HashMap<>();
Map<String, Set<String>> tableTargetObjIDMap = getAllLinkTargetObjIDs(dbObjBatch);
for (String targetTableName : tableTargetObjIDMap.keyS... | java | private Map<String, Map<String, Integer>> getLinkTargetShardNumbers(DBObjectBatch dbObjBatch) {
Map<String, Map<String, Integer>> result = new HashMap<>();
Map<String, Set<String>> tableTargetObjIDMap = getAllLinkTargetObjIDs(dbObjBatch);
for (String targetTableName : tableTargetObjIDMap.keyS... | [
"private",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
">",
"getLinkTargetShardNumbers",
"(",
"DBObjectBatch",
"dbObjBatch",
")",
"{",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
">",
"result",
"=",
"ne... | objects that have no sharding-field value. | [
"objects",
"that",
"have",
"no",
"sharding",
"-",
"field",
"value",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java#L263-L279 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java | BatchObjectUpdater.getAllLinkTargetObjIDs | private Map<String, Set<String>> getAllLinkTargetObjIDs(DBObjectBatch dbObjBatch) {
Map<String, Set<String>> resultMap = new HashMap<>();
for (FieldDefinition fieldDef : m_tableDef.getFieldDefinitions()) {
if (!fieldDef.isLinkField() || !fieldDef.getInverseTableDef().isSharded()) {
... | java | private Map<String, Set<String>> getAllLinkTargetObjIDs(DBObjectBatch dbObjBatch) {
Map<String, Set<String>> resultMap = new HashMap<>();
for (FieldDefinition fieldDef : m_tableDef.getFieldDefinitions()) {
if (!fieldDef.isLinkField() || !fieldDef.getInverseTableDef().isSharded()) {
... | [
"private",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"getAllLinkTargetObjIDs",
"(",
"DBObjectBatch",
"dbObjBatch",
")",
"{",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"resultMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
... | table in the given batch. | [
"table",
"in",
"the",
"given",
"batch",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java#L283-L303 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java | BatchObjectUpdater.getLinkTargetObjIDs | private Set<String> getLinkTargetObjIDs(FieldDefinition linkDef, DBObjectBatch dbObjBatch) {
Set<String> targObjIDs = new HashSet<>();
for (DBObject dbObj : dbObjBatch.getObjects()) {
List<String> objIDs = dbObj.getFieldValues(linkDef.getName());
if (objIDs != null) {
... | java | private Set<String> getLinkTargetObjIDs(FieldDefinition linkDef, DBObjectBatch dbObjBatch) {
Set<String> targObjIDs = new HashSet<>();
for (DBObject dbObj : dbObjBatch.getObjects()) {
List<String> objIDs = dbObj.getFieldValues(linkDef.getName());
if (objIDs != null) {
... | [
"private",
"Set",
"<",
"String",
">",
"getLinkTargetObjIDs",
"(",
"FieldDefinition",
"linkDef",
",",
"DBObjectBatch",
"dbObjBatch",
")",
"{",
"Set",
"<",
"String",
">",
"targObjIDs",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"DBObject",
"dbObj"... | Target object IDs can be in the add or remove set. | [
"Target",
"object",
"IDs",
"can",
"be",
"in",
"the",
"add",
"or",
"remove",
"set",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java#L307-L320 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java | BatchObjectUpdater.getShardNumbers | private Map<String, Integer> getShardNumbers(String tableName, Set<String> targObjIDs) {
TableDefinition tableDef = m_tableDef.getAppDef().getTableDef(tableName);
FieldDefinition shardField = tableDef.getShardingField();
Map<String, String> shardFieldMap =
SpiderService.instance()... | java | private Map<String, Integer> getShardNumbers(String tableName, Set<String> targObjIDs) {
TableDefinition tableDef = m_tableDef.getAppDef().getTableDef(tableName);
FieldDefinition shardField = tableDef.getShardingField();
Map<String, String> shardFieldMap =
SpiderService.instance()... | [
"private",
"Map",
"<",
"String",
",",
"Integer",
">",
"getShardNumbers",
"(",
"String",
"tableName",
",",
"Set",
"<",
"String",
">",
"targObjIDs",
")",
"{",
"TableDefinition",
"tableDef",
"=",
"m_tableDef",
".",
"getAppDef",
"(",
")",
".",
"getTableDef",
"("... | has no value for its sharding-field, leave the map empty for that object ID. | [
"has",
"no",
"value",
"for",
"its",
"sharding",
"-",
"field",
"leave",
"the",
"map",
"empty",
"for",
"that",
"object",
"ID",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/BatchObjectUpdater.java#L324-L336 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/UserDefinition.java | UserDefinition.parse | public void parse(UNode userNode) {
m_userID = userNode.getName();
m_password = null;
m_permissions.clear();
for (String childName : userNode.getMemberNames()) {
UNode childNode = userNode.getMember(childName);
switch (childNode.getName()) {
c... | java | public void parse(UNode userNode) {
m_userID = userNode.getName();
m_password = null;
m_permissions.clear();
for (String childName : userNode.getMemberNames()) {
UNode childNode = userNode.getMember(childName);
switch (childNode.getName()) {
c... | [
"public",
"void",
"parse",
"(",
"UNode",
"userNode",
")",
"{",
"m_userID",
"=",
"userNode",
".",
"getName",
"(",
")",
";",
"m_password",
"=",
"null",
";",
"m_permissions",
".",
"clear",
"(",
")",
";",
"for",
"(",
"String",
"childName",
":",
"userNode",
... | Parse a user definition expressed as a UNode tree.
@param userNode Root {@link UNode}, which must be a "user" node. | [
"Parse",
"a",
"user",
"definition",
"expressed",
"as",
"a",
"UNode",
"tree",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/UserDefinition.java#L171-L207 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/UserDefinition.java | UserDefinition.toDoc | public UNode toDoc() {
UNode userNode = UNode.createMapNode(m_userID, "user");
if (!Utils.isEmpty(m_password)) {
userNode.addValueNode("password", m_password, true);
}
if (!Utils.isEmpty(m_hash)) {
userNode.addValueNode("hash", m_hash, true);
}
Str... | java | public UNode toDoc() {
UNode userNode = UNode.createMapNode(m_userID, "user");
if (!Utils.isEmpty(m_password)) {
userNode.addValueNode("password", m_password, true);
}
if (!Utils.isEmpty(m_hash)) {
userNode.addValueNode("hash", m_hash, true);
}
Str... | [
"public",
"UNode",
"toDoc",
"(",
")",
"{",
"UNode",
"userNode",
"=",
"UNode",
".",
"createMapNode",
"(",
"m_userID",
",",
"\"user\"",
")",
";",
"if",
"(",
"!",
"Utils",
".",
"isEmpty",
"(",
"m_password",
")",
")",
"{",
"userNode",
".",
"addValueNode",
... | Serialize this user definition into a UNode tree.
@return Root {@link UNode} of the serialized tree. | [
"Serialize",
"this",
"user",
"definition",
"into",
"a",
"UNode",
"tree",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/UserDefinition.java#L214-L228 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/QueryResult.java | QueryResult.parseObject | private DBObject parseObject(TableDefinition tableDef, UNode docNode) {
assert tableDef != null;
assert docNode != null;
assert docNode.getName().equals("doc");
// Create the DBObject that we will return and parse the child nodes into it.
DBObject dbObj = new DBObj... | java | private DBObject parseObject(TableDefinition tableDef, UNode docNode) {
assert tableDef != null;
assert docNode != null;
assert docNode.getName().equals("doc");
// Create the DBObject that we will return and parse the child nodes into it.
DBObject dbObj = new DBObj... | [
"private",
"DBObject",
"parseObject",
"(",
"TableDefinition",
"tableDef",
",",
"UNode",
"docNode",
")",
"{",
"assert",
"tableDef",
"!=",
"null",
";",
"assert",
"docNode",
"!=",
"null",
";",
"assert",
"docNode",
".",
"getName",
"(",
")",
".",
"equals",
"(",
... | than the perspective table of the query. | [
"than",
"the",
"perspective",
"table",
"of",
"the",
"query",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/QueryResult.java#L221-L253 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/QueryResult.java | QueryResult.parseLinkValue | private void parseLinkValue(DBObject owningObj,
UNode linkNode,
FieldDefinition linkFieldDef) {
// Prerequisites:
assert owningObj != null;
assert linkNode != null;
assert linkFieldDef != null;
... | java | private void parseLinkValue(DBObject owningObj,
UNode linkNode,
FieldDefinition linkFieldDef) {
// Prerequisites:
assert owningObj != null;
assert linkNode != null;
assert linkFieldDef != null;
... | [
"private",
"void",
"parseLinkValue",
"(",
"DBObject",
"owningObj",
",",
"UNode",
"linkNode",
",",
"FieldDefinition",
"linkFieldDef",
")",
"{",
"// Prerequisites:\r",
"assert",
"owningObj",
"!=",
"null",
";",
"assert",
"linkNode",
"!=",
"null",
";",
"assert",
"link... | object and add it to the linked object cache for the owning object and link. | [
"object",
"and",
"add",
"it",
"to",
"the",
"linked",
"object",
"cache",
"for",
"the",
"owning",
"object",
"and",
"link",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/QueryResult.java#L273-L302 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/QueryResult.java | QueryResult.cacheLinkedObject | private void cacheLinkedObject(String owningObjID,
String linkFieldName,
DBObject linkedObject) {
// Find or create map for the owning object.
Map<String, Map<String, DBObject>> objMap = m_linkedObjectMap.get(owningObjID);
... | java | private void cacheLinkedObject(String owningObjID,
String linkFieldName,
DBObject linkedObject) {
// Find or create map for the owning object.
Map<String, Map<String, DBObject>> objMap = m_linkedObjectMap.get(owningObjID);
... | [
"private",
"void",
"cacheLinkedObject",
"(",
"String",
"owningObjID",
",",
"String",
"linkFieldName",
",",
"DBObject",
"linkedObject",
")",
"{",
"// Find or create map for the owning object.\r",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"DBObject",
">",
... | link field name. | [
"link",
"field",
"name",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/QueryResult.java#L334-L353 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/rest/RESTParameter.java | RESTParameter.fromUNode | public static RESTParameter fromUNode(UNode paramNode) {
RESTParameter param = new RESTParameter();
String name = paramNode.getName();
Utils.require(!Utils.isEmpty(name), "Missing parameter name: " + paramNode);
param.setName(name);
for (UNode childNode : paramNode.getMe... | java | public static RESTParameter fromUNode(UNode paramNode) {
RESTParameter param = new RESTParameter();
String name = paramNode.getName();
Utils.require(!Utils.isEmpty(name), "Missing parameter name: " + paramNode);
param.setName(name);
for (UNode childNode : paramNode.getMe... | [
"public",
"static",
"RESTParameter",
"fromUNode",
"(",
"UNode",
"paramNode",
")",
"{",
"RESTParameter",
"param",
"=",
"new",
"RESTParameter",
"(",
")",
";",
"String",
"name",
"=",
"paramNode",
".",
"getName",
"(",
")",
";",
"Utils",
".",
"require",
"(",
"!... | Create a new RESTParameter object from the given UNode tree.
@param paramNode Root {@link UNode} of a parameter description.
@return New RESTParameter created from UNode tree. | [
"Create",
"a",
"new",
"RESTParameter",
"object",
"from",
"the",
"given",
"UNode",
"tree",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/rest/RESTParameter.java#L121-L144 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/rest/RESTParameter.java | RESTParameter.toDoc | public UNode toDoc() {
UNode paramNode = UNode.createMapNode(m_name);
if (!Utils.isEmpty(m_type)) {
paramNode.addValueNode("_type", m_type);
}
if (m_isRequired) {
paramNode.addValueNode("_required", Boolean.toString(m_isRequired));
}
if (m_paramete... | java | public UNode toDoc() {
UNode paramNode = UNode.createMapNode(m_name);
if (!Utils.isEmpty(m_type)) {
paramNode.addValueNode("_type", m_type);
}
if (m_isRequired) {
paramNode.addValueNode("_required", Boolean.toString(m_isRequired));
}
if (m_paramete... | [
"public",
"UNode",
"toDoc",
"(",
")",
"{",
"UNode",
"paramNode",
"=",
"UNode",
".",
"createMapNode",
"(",
"m_name",
")",
";",
"if",
"(",
"!",
"Utils",
".",
"isEmpty",
"(",
"m_type",
")",
")",
"{",
"paramNode",
".",
"addValueNode",
"(",
"\"_type\"",
","... | Serialize this RESTParameter into a UNode tree and return the root node.
@return Root {@link UNode} of the serialized tree. | [
"Serialize",
"this",
"RESTParameter",
"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/rest/RESTParameter.java#L151-L165 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/rest/RESTParameter.java | RESTParameter.add | public RESTParameter add(RESTParameter childParam) {
Utils.require(!Utils.isEmpty(childParam.getName()), "Child parameter name cannot be empty");
m_parameters.add(childParam);
return this;
} | java | public RESTParameter add(RESTParameter childParam) {
Utils.require(!Utils.isEmpty(childParam.getName()), "Child parameter name cannot be empty");
m_parameters.add(childParam);
return this;
} | [
"public",
"RESTParameter",
"add",
"(",
"RESTParameter",
"childParam",
")",
"{",
"Utils",
".",
"require",
"(",
"!",
"Utils",
".",
"isEmpty",
"(",
"childParam",
".",
"getName",
"(",
")",
")",
",",
"\"Child parameter name cannot be empty\"",
")",
";",
"m_parameters... | Add the given RESTParameter as a child of this parameter. This parameter is
returned to support builder syntax.
@param childParam New child RESTParameter of this parameter. The child parameter
name must be unique.
@return This parameter object. | [
"Add",
"the",
"given",
"RESTParameter",
"as",
"a",
"child",
"of",
"this",
"parameter",
".",
"This",
"parameter",
"is",
"returned",
"to",
"support",
"builder",
"syntax",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/rest/RESTParameter.java#L187-L191 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/rest/RESTParameter.java | RESTParameter.add | public RESTParameter add(String childParamName, String childParamType) {
return add(new RESTParameter(childParamName, childParamType));
} | java | public RESTParameter add(String childParamName, String childParamType) {
return add(new RESTParameter(childParamName, childParamType));
} | [
"public",
"RESTParameter",
"add",
"(",
"String",
"childParamName",
",",
"String",
"childParamType",
")",
"{",
"return",
"add",
"(",
"new",
"RESTParameter",
"(",
"childParamName",
",",
"childParamType",
")",
")",
";",
"}"
] | Add a new child parameter with the given name and type to this parameter. The child
parameter will not be marked as required. This parameter is returned to support
builder syntax.
@param childParamName Name of new child parameter.
@param childParamType Type of new child parameter.
@return This p... | [
"Add",
"a",
"new",
"child",
"parameter",
"with",
"the",
"given",
"name",
"and",
"type",
"to",
"this",
"parameter",
".",
"The",
"child",
"parameter",
"will",
"not",
"be",
"marked",
"as",
"required",
".",
"This",
"parameter",
"is",
"returned",
"to",
"support... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/rest/RESTParameter.java#L202-L204 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/ThriftService.java | ThriftService.getDBConnection | DBConn getDBConnection() {
DBConn dbConn = null;
synchronized (m_dbConns) {
if (m_dbConns.size() > 0) {
dbConn = m_dbConns.poll();
} else {
dbConn = createAndConnectConn(m_keyspace);
}
}
return dbConn;
} | java | DBConn getDBConnection() {
DBConn dbConn = null;
synchronized (m_dbConns) {
if (m_dbConns.size() > 0) {
dbConn = m_dbConns.poll();
} else {
dbConn = createAndConnectConn(m_keyspace);
}
}
return dbConn;
} | [
"DBConn",
"getDBConnection",
"(",
")",
"{",
"DBConn",
"dbConn",
"=",
"null",
";",
"synchronized",
"(",
"m_dbConns",
")",
"{",
"if",
"(",
"m_dbConns",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"dbConn",
"=",
"m_dbConns",
".",
"poll",
"(",
")",
";",
... | Get an available database connection from the pool, creating a new one if needed. | [
"Get",
"an",
"available",
"database",
"connection",
"from",
"the",
"pool",
"creating",
"a",
"new",
"one",
"if",
"needed",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/ThriftService.java#L224-L234 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/ThriftService.java | ThriftService.connectDBConn | void connectDBConn(DBConn dbConn) throws DBNotAvailableException, RuntimeException {
// If we're using failover hosts, see if it's time to try primary hosts again.
if (m_bUseSecondaryHosts &&
(System.currentTimeMillis() - m_lastPrimaryHostCheckTimeMillis) > getParamInt("primary_host_recheck_... | java | void connectDBConn(DBConn dbConn) throws DBNotAvailableException, RuntimeException {
// If we're using failover hosts, see if it's time to try primary hosts again.
if (m_bUseSecondaryHosts &&
(System.currentTimeMillis() - m_lastPrimaryHostCheckTimeMillis) > getParamInt("primary_host_recheck_... | [
"void",
"connectDBConn",
"(",
"DBConn",
"dbConn",
")",
"throws",
"DBNotAvailableException",
",",
"RuntimeException",
"{",
"// If we're using failover hosts, see if it's time to try primary hosts again.",
"if",
"(",
"m_bUseSecondaryHosts",
"&&",
"(",
"System",
".",
"currentTimeM... | configured keyspace is not available, a RuntimeException is thrown. | [
"configured",
"keyspace",
"is",
"not",
"available",
"a",
"RuntimeException",
"is",
"thrown",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/ThriftService.java#L264-L311 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/ThriftService.java | ThriftService.createAndConnectConn | private DBConn createAndConnectConn(String keyspace) throws DBNotAvailableException, RuntimeException {
DBConn dbConn = new DBConn(this, keyspace);
connectDBConn(dbConn);
return dbConn;
} | java | private DBConn createAndConnectConn(String keyspace) throws DBNotAvailableException, RuntimeException {
DBConn dbConn = new DBConn(this, keyspace);
connectDBConn(dbConn);
return dbConn;
} | [
"private",
"DBConn",
"createAndConnectConn",
"(",
"String",
"keyspace",
")",
"throws",
"DBNotAvailableException",
",",
"RuntimeException",
"{",
"DBConn",
"dbConn",
"=",
"new",
"DBConn",
"(",
"this",
",",
"keyspace",
")",
";",
"connectDBConn",
"(",
"dbConn",
")",
... | the given keyspace does not exist. | [
"the",
"given",
"keyspace",
"does",
"not",
"exist",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/ThriftService.java#L319-L323 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/ThriftService.java | ThriftService.chooseHost | private String chooseHost(String[] dbHosts) {
String host = null;
synchronized (m_lastHostLock) {
if (dbHosts.length == 1) {
host = dbHosts[0];
} else if (!Utils.isEmpty(m_lastHost)) {
for (int index = 0; host == null && index < dbHosts.length; ind... | java | private String chooseHost(String[] dbHosts) {
String host = null;
synchronized (m_lastHostLock) {
if (dbHosts.length == 1) {
host = dbHosts[0];
} else if (!Utils.isEmpty(m_lastHost)) {
for (int index = 0; host == null && index < dbHosts.length; ind... | [
"private",
"String",
"chooseHost",
"(",
"String",
"[",
"]",
"dbHosts",
")",
"{",
"String",
"host",
"=",
"null",
";",
"synchronized",
"(",
"m_lastHostLock",
")",
"{",
"if",
"(",
"dbHosts",
".",
"length",
"==",
"1",
")",
"{",
"host",
"=",
"dbHosts",
"[",... | Choose the next Cassandra host name in the list or a random one. | [
"Choose",
"the",
"next",
"Cassandra",
"host",
"name",
"in",
"the",
"list",
"or",
"a",
"random",
"one",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/ThriftService.java#L326-L344 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java | LinkFieldUpdater.deleteValuesForField | @Override
public void deleteValuesForField() {
for (String targetObjID : m_dbObj.getFieldValues(m_fieldName)) {
deleteLinkInverseValue(targetObjID);
}
if (m_linkDef.isSharded()) {
deleteShardedLinkTermRows();
}
} | java | @Override
public void deleteValuesForField() {
for (String targetObjID : m_dbObj.getFieldValues(m_fieldName)) {
deleteLinkInverseValue(targetObjID);
}
if (m_linkDef.isSharded()) {
deleteShardedLinkTermRows();
}
} | [
"@",
"Override",
"public",
"void",
"deleteValuesForField",
"(",
")",
"{",
"for",
"(",
"String",
"targetObjID",
":",
"m_dbObj",
".",
"getFieldValues",
"(",
"m_fieldName",
")",
")",
"{",
"deleteLinkInverseValue",
"(",
"targetObjID",
")",
";",
"}",
"if",
"(",
"... | Clean-up inverses and sharded term rows. | [
"Clean",
"-",
"up",
"inverses",
"and",
"sharded",
"term",
"rows",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java#L72-L80 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java | LinkFieldUpdater.addInverseLinkValue | private void addInverseLinkValue(String targetObjID) {
int shardNo = m_tableDef.getShardNumber(m_dbObj);
if (shardNo > 0 && m_invLinkDef.isSharded()) {
m_dbTran.addShardedLinkValue(targetObjID, m_invLinkDef, m_dbObj.getObjectID(), shardNo);
} else {
m_dbTran.addLinkV... | java | private void addInverseLinkValue(String targetObjID) {
int shardNo = m_tableDef.getShardNumber(m_dbObj);
if (shardNo > 0 && m_invLinkDef.isSharded()) {
m_dbTran.addShardedLinkValue(targetObjID, m_invLinkDef, m_dbObj.getObjectID(), shardNo);
} else {
m_dbTran.addLinkV... | [
"private",
"void",
"addInverseLinkValue",
"(",
"String",
"targetObjID",
")",
"{",
"int",
"shardNo",
"=",
"m_tableDef",
".",
"getShardNumber",
"(",
"m_dbObj",
")",
";",
"if",
"(",
"shardNo",
">",
"0",
"&&",
"m_invLinkDef",
".",
"isSharded",
"(",
")",
")",
"... | for the inverse reference. | [
"for",
"the",
"inverse",
"reference",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java#L86-L100 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java | LinkFieldUpdater.addLinkValue | private void addLinkValue(String targetObjID) {
int targetShardNo = getTargetObjectShardNumber(targetObjID);
if (targetShardNo > 0 && m_linkDef.isSharded()) {
m_dbTran.addShardedLinkValue(m_dbObj.getObjectID(), m_linkDef, targetObjID, targetShardNo);
} else {
m_dbTra... | java | private void addLinkValue(String targetObjID) {
int targetShardNo = getTargetObjectShardNumber(targetObjID);
if (targetShardNo > 0 && m_linkDef.isSharded()) {
m_dbTran.addShardedLinkValue(m_dbObj.getObjectID(), m_linkDef, targetObjID, targetShardNo);
} else {
m_dbTra... | [
"private",
"void",
"addLinkValue",
"(",
"String",
"targetObjID",
")",
"{",
"int",
"targetShardNo",
"=",
"getTargetObjectShardNumber",
"(",
"targetObjID",
")",
";",
"if",
"(",
"targetShardNo",
">",
"0",
"&&",
"m_linkDef",
".",
"isSharded",
"(",
")",
")",
"{",
... | Add mutations to add a reference via our link to the given target object ID. | [
"Add",
"mutations",
"to",
"add",
"a",
"reference",
"via",
"our",
"link",
"to",
"the",
"given",
"target",
"object",
"ID",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java#L103-L111 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java | LinkFieldUpdater.getTargetObjectShardNumber | private int getTargetObjectShardNumber(String targetObjID) {
int targetShardNo = 0;
if (m_invTableDef.isSharded() &&
m_targetObjShardNos != null &&
m_targetObjShardNos.containsKey(targetObjID)) {
targetShardNo = m_targetObjShardNos.get(targetObjID);
}
... | java | private int getTargetObjectShardNumber(String targetObjID) {
int targetShardNo = 0;
if (m_invTableDef.isSharded() &&
m_targetObjShardNos != null &&
m_targetObjShardNos.containsKey(targetObjID)) {
targetShardNo = m_targetObjShardNos.get(targetObjID);
}
... | [
"private",
"int",
"getTargetObjectShardNumber",
"(",
"String",
"targetObjID",
")",
"{",
"int",
"targetShardNo",
"=",
"0",
";",
"if",
"(",
"m_invTableDef",
".",
"isSharded",
"(",
")",
"&&",
"m_targetObjShardNos",
"!=",
"null",
"&&",
"m_targetObjShardNos",
".",
"c... | Get the shard number of the target object ID, if cached. | [
"Get",
"the",
"shard",
"number",
"of",
"the",
"target",
"object",
"ID",
"if",
"cached",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java#L114-L122 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java | LinkFieldUpdater.deleteLinkInverseValue | private void deleteLinkInverseValue(String targetObjID) {
int shardNo = m_tableDef.getShardNumber(m_dbObj);
if (shardNo > 0 && m_invLinkDef.isSharded()) {
m_dbTran.deleteShardedLinkValue(targetObjID, m_invLinkDef, m_dbObj.getObjectID(), shardNo);
} else {
m_dbTran.de... | java | private void deleteLinkInverseValue(String targetObjID) {
int shardNo = m_tableDef.getShardNumber(m_dbObj);
if (shardNo > 0 && m_invLinkDef.isSharded()) {
m_dbTran.deleteShardedLinkValue(targetObjID, m_invLinkDef, m_dbObj.getObjectID(), shardNo);
} else {
m_dbTran.de... | [
"private",
"void",
"deleteLinkInverseValue",
"(",
"String",
"targetObjID",
")",
"{",
"int",
"shardNo",
"=",
"m_tableDef",
".",
"getShardNumber",
"(",
"m_dbObj",
")",
";",
"if",
"(",
"shardNo",
">",
"0",
"&&",
"m_invLinkDef",
".",
"isSharded",
"(",
")",
")",
... | Delete the inverse reference to the given target object ID. | [
"Delete",
"the",
"inverse",
"reference",
"to",
"the",
"given",
"target",
"object",
"ID",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java#L125-L132 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java | LinkFieldUpdater.deleteLinkValue | private void deleteLinkValue(String targetObjID) {
int targetShardNo = getTargetObjectShardNumber(targetObjID);
if (targetShardNo > 0 && m_linkDef.isSharded()) {
m_dbTran.deleteShardedLinkValue(targetObjID, m_linkDef, m_dbObj.getObjectID(), targetShardNo);
} else {
m... | java | private void deleteLinkValue(String targetObjID) {
int targetShardNo = getTargetObjectShardNumber(targetObjID);
if (targetShardNo > 0 && m_linkDef.isSharded()) {
m_dbTran.deleteShardedLinkValue(targetObjID, m_linkDef, m_dbObj.getObjectID(), targetShardNo);
} else {
m... | [
"private",
"void",
"deleteLinkValue",
"(",
"String",
"targetObjID",
")",
"{",
"int",
"targetShardNo",
"=",
"getTargetObjectShardNumber",
"(",
"targetObjID",
")",
";",
"if",
"(",
"targetShardNo",
">",
"0",
"&&",
"m_linkDef",
".",
"isSharded",
"(",
")",
")",
"{"... | Delete the reference via our link to the given target object ID and its inverse. | [
"Delete",
"the",
"reference",
"via",
"our",
"link",
"to",
"the",
"given",
"target",
"object",
"ID",
"and",
"its",
"inverse",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java#L135-L143 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java | LinkFieldUpdater.deleteShardedLinkTermRows | private void deleteShardedLinkTermRows() {
// When link is shard, its sharded extent table is also sharded.
Set<Integer> shardNums = SpiderService.instance().getShards(m_invTableDef).keySet();
for (Integer shardNumber : shardNums) {
m_dbTran.deleteShardedLinkRow(m_linkDef, m_dbOb... | java | private void deleteShardedLinkTermRows() {
// When link is shard, its sharded extent table is also sharded.
Set<Integer> shardNums = SpiderService.instance().getShards(m_invTableDef).keySet();
for (Integer shardNumber : shardNums) {
m_dbTran.deleteShardedLinkRow(m_linkDef, m_dbOb... | [
"private",
"void",
"deleteShardedLinkTermRows",
"(",
")",
"{",
"// When link is shard, its sharded extent table is also sharded.\r",
"Set",
"<",
"Integer",
">",
"shardNums",
"=",
"SpiderService",
".",
"instance",
"(",
")",
".",
"getShards",
"(",
"m_invTableDef",
")",
".... | Delete all possible term rows that might exist for our sharded link. | [
"Delete",
"all",
"possible",
"term",
"rows",
"that",
"might",
"exist",
"for",
"our",
"sharded",
"link",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java#L146-L152 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java | LinkFieldUpdater.updateLinkAddValues | private boolean updateLinkAddValues() {
List<String> linkValues = m_dbObj.getFieldValues(m_linkDef.getName());
if (linkValues == null || linkValues.size() == 0) {
return false;
}
Set<String> linkValueSet = new HashSet<>(linkValues); // remove duplicates
for (S... | java | private boolean updateLinkAddValues() {
List<String> linkValues = m_dbObj.getFieldValues(m_linkDef.getName());
if (linkValues == null || linkValues.size() == 0) {
return false;
}
Set<String> linkValueSet = new HashSet<>(linkValues); // remove duplicates
for (S... | [
"private",
"boolean",
"updateLinkAddValues",
"(",
")",
"{",
"List",
"<",
"String",
">",
"linkValues",
"=",
"m_dbObj",
".",
"getFieldValues",
"(",
"m_linkDef",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"linkValues",
"==",
"null",
"||",
"linkValues",
".... | Add new values for our link. Return true if at least one update made. | [
"Add",
"new",
"values",
"for",
"our",
"link",
".",
"Return",
"true",
"if",
"at",
"least",
"one",
"update",
"made",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java#L155-L165 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java | LinkFieldUpdater.updateLinkRemoveValues | private boolean updateLinkRemoveValues() {
Set<String> removeSet = m_dbObj.getRemoveValues(m_fieldName);
List<String> addSet = m_dbObj.getFieldValues(m_fieldName);
if (removeSet != null && addSet != null) {
removeSet.removeAll(addSet); // add+remove of same ID negates the remo... | java | private boolean updateLinkRemoveValues() {
Set<String> removeSet = m_dbObj.getRemoveValues(m_fieldName);
List<String> addSet = m_dbObj.getFieldValues(m_fieldName);
if (removeSet != null && addSet != null) {
removeSet.removeAll(addSet); // add+remove of same ID negates the remo... | [
"private",
"boolean",
"updateLinkRemoveValues",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"removeSet",
"=",
"m_dbObj",
".",
"getRemoveValues",
"(",
"m_fieldName",
")",
";",
"List",
"<",
"String",
">",
"addSet",
"=",
"m_dbObj",
".",
"getFieldValues",
"(",
"m_... | Process removes for our link. Return true if at least one update made. | [
"Process",
"removes",
"for",
"our",
"link",
".",
"Return",
"true",
"if",
"at",
"least",
"one",
"update",
"made",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/LinkFieldUpdater.java#L168-L182 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java | ShardCache.clear | public synchronized void clear(ApplicationDefinition appDef) {
String appName = appDef.getAppName();
for (TableDefinition tableDef : appDef.getTableDefinitions().values()) {
m_cacheMap.remove(appName + "/" + tableDef.getTableName()); // might have no entry
}
m_appShardMa... | java | public synchronized void clear(ApplicationDefinition appDef) {
String appName = appDef.getAppName();
for (TableDefinition tableDef : appDef.getTableDefinitions().values()) {
m_cacheMap.remove(appName + "/" + tableDef.getTableName()); // might have no entry
}
m_appShardMa... | [
"public",
"synchronized",
"void",
"clear",
"(",
"ApplicationDefinition",
"appDef",
")",
"{",
"String",
"appName",
"=",
"appDef",
".",
"getAppName",
"(",
")",
";",
"for",
"(",
"TableDefinition",
"tableDef",
":",
"appDef",
".",
"getTableDefinitions",
"(",
")",
"... | Clear all cached shard information for the given application.
@param appDef {@link ApplicationDefinition} of an application. | [
"Clear",
"all",
"cached",
"shard",
"information",
"for",
"the",
"given",
"application",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java#L70-L76 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java | ShardCache.verifyShard | public synchronized void verifyShard(TableDefinition tableDef, int shardNumber) {
assert tableDef != null;
assert tableDef.isSharded();
assert shardNumber > 0;
Map<String, Map<Integer, Date>> tableMap = m_appShardMap.get(tableDef.getAppDef().getAppName());
if (tabl... | java | public synchronized void verifyShard(TableDefinition tableDef, int shardNumber) {
assert tableDef != null;
assert tableDef.isSharded();
assert shardNumber > 0;
Map<String, Map<Integer, Date>> tableMap = m_appShardMap.get(tableDef.getAppDef().getAppName());
if (tabl... | [
"public",
"synchronized",
"void",
"verifyShard",
"(",
"TableDefinition",
"tableDef",
",",
"int",
"shardNumber",
")",
"{",
"assert",
"tableDef",
"!=",
"null",
";",
"assert",
"tableDef",
".",
"isSharded",
"(",
")",
";",
"assert",
"shardNumber",
">",
"0",
";",
... | Verify that the shard with the given number has been registered for the given table.
If it hasn't, the shard's starting date is computed, the shard is registered in the
_shards row, and the start date is cached.
@param tableDef TableDefinition of a sharded table.
@param shardNumber Shard number (must be > 0). | [
"Verify",
"that",
"the",
"shard",
"with",
"the",
"given",
"number",
"has",
"been",
"registered",
"for",
"the",
"given",
"table",
".",
"If",
"it",
"hasn",
"t",
"the",
"shard",
"s",
"starting",
"date",
"is",
"computed",
"the",
"shard",
"is",
"registered",
... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java#L119-L137 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java | ShardCache.addShardStart | private void addShardStart(TableDefinition tableDef, int shardNumber, Date shardDate) {
SpiderTransaction spiderTran = new SpiderTransaction();
spiderTran.addShardStart(tableDef, shardNumber, shardDate);
Tenant tenant = Tenant.getTenant(tableDef);
DBTransaction dbTran = DBService.ins... | java | private void addShardStart(TableDefinition tableDef, int shardNumber, Date shardDate) {
SpiderTransaction spiderTran = new SpiderTransaction();
spiderTran.addShardStart(tableDef, shardNumber, shardDate);
Tenant tenant = Tenant.getTenant(tableDef);
DBTransaction dbTran = DBService.ins... | [
"private",
"void",
"addShardStart",
"(",
"TableDefinition",
"tableDef",
",",
"int",
"shardNumber",
",",
"Date",
"shardDate",
")",
"{",
"SpiderTransaction",
"spiderTran",
"=",
"new",
"SpiderTransaction",
"(",
")",
";",
"spiderTran",
".",
"addShardStart",
"(",
"tabl... | Create a local transaction to add the register the given shard, then cache it. | [
"Create",
"a",
"local",
"transaction",
"to",
"add",
"the",
"register",
"the",
"given",
"shard",
"then",
"cache",
"it",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java#L142-L152 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java | ShardCache.cacheShardValue | private void cacheShardValue(TableDefinition tableDef,
Integer shardNumber,
Date shardStart) {
// Get or create the app name -> table map
String appName = tableDef.getAppDef().getAppName();
Map<String, Map<... | java | private void cacheShardValue(TableDefinition tableDef,
Integer shardNumber,
Date shardStart) {
// Get or create the app name -> table map
String appName = tableDef.getAppDef().getAppName();
Map<String, Map<... | [
"private",
"void",
"cacheShardValue",
"(",
"TableDefinition",
"tableDef",
",",
"Integer",
"shardNumber",
",",
"Date",
"shardStart",
")",
"{",
"// Get or create the app name -> table map\r",
"String",
"appName",
"=",
"tableDef",
".",
"getAppDef",
"(",
")",
".",
"getApp... | Cache the given shard. | [
"Cache",
"the",
"given",
"shard",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java#L155-L178 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java | ShardCache.loadShardCache | private void loadShardCache(TableDefinition tableDef) {
String appName = tableDef.getAppDef().getAppName();
String tableName = tableDef.getTableName();
m_logger.debug("Loading shard cache for {}.{}", appName, tableName);
Date cacheDate = new Date();
String cacheKey... | java | private void loadShardCache(TableDefinition tableDef) {
String appName = tableDef.getAppDef().getAppName();
String tableName = tableDef.getTableName();
m_logger.debug("Loading shard cache for {}.{}", appName, tableName);
Date cacheDate = new Date();
String cacheKey... | [
"private",
"void",
"loadShardCache",
"(",
"TableDefinition",
"tableDef",
")",
"{",
"String",
"appName",
"=",
"tableDef",
".",
"getAppDef",
"(",
")",
".",
"getAppName",
"(",
")",
";",
"String",
"tableName",
"=",
"tableDef",
".",
"getTableName",
"(",
")",
";",... | worry about concurrency. | [
"worry",
"about",
"concurrency",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java#L182-L210 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java | ShardCache.isTooOld | private boolean isTooOld(Date cacheDate) {
Date now = new Date();
return now.getTime() - cacheDate.getTime() > MAX_CACHE_TIME_MILLIS;
} | java | private boolean isTooOld(Date cacheDate) {
Date now = new Date();
return now.getTime() - cacheDate.getTime() > MAX_CACHE_TIME_MILLIS;
} | [
"private",
"boolean",
"isTooOld",
"(",
"Date",
"cacheDate",
")",
"{",
"Date",
"now",
"=",
"new",
"Date",
"(",
")",
";",
"return",
"now",
".",
"getTime",
"(",
")",
"-",
"cacheDate",
".",
"getTime",
"(",
")",
">",
"MAX_CACHE_TIME_MILLIS",
";",
"}"
] | Return true if given date has exceeded MAX_CACHE_TIME_MILLIS time. | [
"Return",
"true",
"if",
"given",
"date",
"has",
"exceeded",
"MAX_CACHE_TIME_MILLIS",
"time",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ShardCache.java#L213-L216 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.addNewObject | public ObjectResult addNewObject(SpiderTransaction parentTran, DBObject dbObj) {
ObjectResult result = new ObjectResult();
try {
addBrandNewObject(dbObj);
result.setObjectID(dbObj.getObjectID());
result.setUpdated(true);
parentTran.mergeSubTransactio... | java | public ObjectResult addNewObject(SpiderTransaction parentTran, DBObject dbObj) {
ObjectResult result = new ObjectResult();
try {
addBrandNewObject(dbObj);
result.setObjectID(dbObj.getObjectID());
result.setUpdated(true);
parentTran.mergeSubTransactio... | [
"public",
"ObjectResult",
"addNewObject",
"(",
"SpiderTransaction",
"parentTran",
",",
"DBObject",
"dbObj",
")",
"{",
"ObjectResult",
"result",
"=",
"new",
"ObjectResult",
"(",
")",
";",
"try",
"{",
"addBrandNewObject",
"(",
"dbObj",
")",
";",
"result",
".",
"... | Add the given DBObject to the database as a new object. No check is made to see if
an object with the same ID already exists. If the update is successful, updates are
merged to the given parent SpiderTransaction.
@param parentTran Parent {@link SpiderTransaction} to which updates are applied
if the add is successfu... | [
"Add",
"the",
"given",
"DBObject",
"to",
"the",
"database",
"as",
"a",
"new",
"object",
".",
"No",
"check",
"is",
"made",
"to",
"see",
"if",
"an",
"object",
"with",
"the",
"same",
"ID",
"already",
"exists",
".",
"If",
"the",
"update",
"is",
"successful... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L112-L124 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.deleteObject | public ObjectResult deleteObject(SpiderTransaction parentTran, String objID) {
ObjectResult result = new ObjectResult(objID);
try {
result.setObjectID(objID);
DBObject dbObj = SpiderService.instance().getObject(m_tableDef, objID);
if (dbObj != null) {
... | java | public ObjectResult deleteObject(SpiderTransaction parentTran, String objID) {
ObjectResult result = new ObjectResult(objID);
try {
result.setObjectID(objID);
DBObject dbObj = SpiderService.instance().getObject(m_tableDef, objID);
if (dbObj != null) {
... | [
"public",
"ObjectResult",
"deleteObject",
"(",
"SpiderTransaction",
"parentTran",
",",
"String",
"objID",
")",
"{",
"ObjectResult",
"result",
"=",
"new",
"ObjectResult",
"(",
"objID",
")",
";",
"try",
"{",
"result",
".",
"setObjectID",
"(",
"objID",
")",
";",
... | Delete the object with the given object ID. Because of idempotent update semantics,
it is not an error if the object does not exist. If an object is actually deleted,
updates are merged to the given parent SpiderTransaction.
@param parentTran Parent {@link SpiderTransaction} to which updates are applied
if the dele... | [
"Delete",
"the",
"object",
"with",
"the",
"given",
"object",
"ID",
".",
"Because",
"of",
"idempotent",
"update",
"semantics",
"it",
"is",
"not",
"an",
"error",
"if",
"the",
"object",
"does",
"not",
"exist",
".",
"If",
"an",
"object",
"is",
"actually",
"d... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L137-L155 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.updateObject | public ObjectResult updateObject(SpiderTransaction parentTran,
DBObject dbObj,
Map<String, String> currScalarMap) {
ObjectResult result = new ObjectResult();
try {
result.setObjectID(dbObj.getObjectID... | java | public ObjectResult updateObject(SpiderTransaction parentTran,
DBObject dbObj,
Map<String, String> currScalarMap) {
ObjectResult result = new ObjectResult();
try {
result.setObjectID(dbObj.getObjectID... | [
"public",
"ObjectResult",
"updateObject",
"(",
"SpiderTransaction",
"parentTran",
",",
"DBObject",
"dbObj",
",",
"Map",
"<",
"String",
",",
"String",
">",
"currScalarMap",
")",
"{",
"ObjectResult",
"result",
"=",
"new",
"ObjectResult",
"(",
")",
";",
"try",
"{... | Update the given object, whose current values have been pre-fetched. The object
must exist, and the values in the given DBObject are compared to the given current
values to determine which ones are being added or updated. If an update is actually
made, updates are merged to the given parent SpiderTransaction.
@param p... | [
"Update",
"the",
"given",
"object",
"whose",
"current",
"values",
"have",
"been",
"pre",
"-",
"fetched",
".",
"The",
"object",
"must",
"exist",
"and",
"the",
"values",
"in",
"the",
"given",
"DBObject",
"are",
"compared",
"to",
"the",
"given",
"current",
"v... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L171-L190 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.addBrandNewObject | private boolean addBrandNewObject(DBObject dbObj) {
if (Utils.isEmpty(dbObj.getObjectID())) {
dbObj.setObjectID(Utils.base64FromBinary(IDGenerator.nextID()));
}
checkForNewShard(dbObj);
for (String fieldName : dbObj.getUpdatedFieldNames()) {
FieldUpdater fie... | java | private boolean addBrandNewObject(DBObject dbObj) {
if (Utils.isEmpty(dbObj.getObjectID())) {
dbObj.setObjectID(Utils.base64FromBinary(IDGenerator.nextID()));
}
checkForNewShard(dbObj);
for (String fieldName : dbObj.getUpdatedFieldNames()) {
FieldUpdater fie... | [
"private",
"boolean",
"addBrandNewObject",
"(",
"DBObject",
"dbObj",
")",
"{",
"if",
"(",
"Utils",
".",
"isEmpty",
"(",
"dbObj",
".",
"getObjectID",
"(",
")",
")",
")",
"{",
"dbObj",
".",
"setObjectID",
"(",
"Utils",
".",
"base64FromBinary",
"(",
"IDGenera... | Add new object to the database. | [
"Add",
"new",
"object",
"to",
"the",
"database",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L195-L205 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.buildErrorStatus | private void buildErrorStatus(ObjectResult result, String objID, Throwable ex) {
result.setStatus(ObjectResult.Status.ERROR);
result.setErrorMessage(ex.getLocalizedMessage());
if (!Utils.isEmpty(objID)) {
result.setObjectID(objID);
}
if (ex instanceof IllegalArg... | java | private void buildErrorStatus(ObjectResult result, String objID, Throwable ex) {
result.setStatus(ObjectResult.Status.ERROR);
result.setErrorMessage(ex.getLocalizedMessage());
if (!Utils.isEmpty(objID)) {
result.setObjectID(objID);
}
if (ex instanceof IllegalArg... | [
"private",
"void",
"buildErrorStatus",
"(",
"ObjectResult",
"result",
",",
"String",
"objID",
",",
"Throwable",
"ex",
")",
"{",
"result",
".",
"setStatus",
"(",
"ObjectResult",
".",
"Status",
".",
"ERROR",
")",
";",
"result",
".",
"setErrorMessage",
"(",
"ex... | Add error fields to the given ObjectResult due to the given exception. | [
"Add",
"error",
"fields",
"to",
"the",
"given",
"ObjectResult",
"due",
"to",
"the",
"given",
"exception",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L208-L221 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.checkForNewShard | private void checkForNewShard(DBObject dbObj) {
int shardNumber = m_tableDef.getShardNumber(dbObj);
if (shardNumber > 0) {
SpiderService.instance().verifyShard(m_tableDef, shardNumber);
}
} | java | private void checkForNewShard(DBObject dbObj) {
int shardNumber = m_tableDef.getShardNumber(dbObj);
if (shardNumber > 0) {
SpiderService.instance().verifyShard(m_tableDef, shardNumber);
}
} | [
"private",
"void",
"checkForNewShard",
"(",
"DBObject",
"dbObj",
")",
"{",
"int",
"shardNumber",
"=",
"m_tableDef",
".",
"getShardNumber",
"(",
"dbObj",
")",
";",
"if",
"(",
"shardNumber",
">",
"0",
")",
"{",
"SpiderService",
".",
"instance",
"(",
")",
"."... | If object is sharded, see if we need to add a new column to the "current shards" row. | [
"If",
"object",
"is",
"sharded",
"see",
"if",
"we",
"need",
"to",
"add",
"a",
"new",
"column",
"to",
"the",
"current",
"shards",
"row",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L224-L229 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.checkNewlySharded | private void checkNewlySharded(DBObject dbObj, Map<String, String> currScalarMap) {
if (!m_tableDef.isSharded()) {
return;
}
String shardingFieldName = m_tableDef.getShardingField().getName();
if (!currScalarMap.containsKey(shardingFieldName)) {
m_dbTran.add... | java | private void checkNewlySharded(DBObject dbObj, Map<String, String> currScalarMap) {
if (!m_tableDef.isSharded()) {
return;
}
String shardingFieldName = m_tableDef.getShardingField().getName();
if (!currScalarMap.containsKey(shardingFieldName)) {
m_dbTran.add... | [
"private",
"void",
"checkNewlySharded",
"(",
"DBObject",
"dbObj",
",",
"Map",
"<",
"String",
",",
"String",
">",
"currScalarMap",
")",
"{",
"if",
"(",
"!",
"m_tableDef",
".",
"isSharded",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"shardingFieldName... | previously undetermined but is not being assigned to a shard. | [
"previously",
"undetermined",
"but",
"is",
"not",
"being",
"assigned",
"to",
"a",
"shard",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L233-L241 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.deleteObject | private void deleteObject(DBObject dbObj) {
for (String fieldName : dbObj.getUpdatedFieldNames()) {
FieldUpdater fieldUpdater = FieldUpdater.createFieldUpdater(this, dbObj, fieldName);
fieldUpdater.deleteValuesForField();
}
m_dbTran.deleteObjectRow(m_tableDef, dbObj.... | java | private void deleteObject(DBObject dbObj) {
for (String fieldName : dbObj.getUpdatedFieldNames()) {
FieldUpdater fieldUpdater = FieldUpdater.createFieldUpdater(this, dbObj, fieldName);
fieldUpdater.deleteValuesForField();
}
m_dbTran.deleteObjectRow(m_tableDef, dbObj.... | [
"private",
"void",
"deleteObject",
"(",
"DBObject",
"dbObj",
")",
"{",
"for",
"(",
"String",
"fieldName",
":",
"dbObj",
".",
"getUpdatedFieldNames",
"(",
")",
")",
"{",
"FieldUpdater",
"fieldUpdater",
"=",
"FieldUpdater",
".",
"createFieldUpdater",
"(",
"this",
... | Delete term columns and inverses for field values and the object's primary row. | [
"Delete",
"term",
"columns",
"and",
"inverses",
"for",
"field",
"values",
"and",
"the",
"object",
"s",
"primary",
"row",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L244-L250 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.updateExistingObject | private boolean updateExistingObject(DBObject dbObj, Map<String, String> currScalarMap) {
if (objectIsChangingShards(dbObj, currScalarMap)) {
return updateShardedObjectMove(dbObj);
} else {
return updateObjectSameShard(dbObj, currScalarMap);
}
} | java | private boolean updateExistingObject(DBObject dbObj, Map<String, String> currScalarMap) {
if (objectIsChangingShards(dbObj, currScalarMap)) {
return updateShardedObjectMove(dbObj);
} else {
return updateObjectSameShard(dbObj, currScalarMap);
}
} | [
"private",
"boolean",
"updateExistingObject",
"(",
"DBObject",
"dbObj",
",",
"Map",
"<",
"String",
",",
"String",
">",
"currScalarMap",
")",
"{",
"if",
"(",
"objectIsChangingShards",
"(",
"dbObj",
",",
"currScalarMap",
")",
")",
"{",
"return",
"updateShardedObje... | Update the given object using the appropriate strategy. | [
"Update",
"the",
"given",
"object",
"using",
"the",
"appropriate",
"strategy",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L253-L259 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.updateObjectSameShard | private boolean updateObjectSameShard(DBObject dbObj, Map<String, String> currScalarMap) {
boolean bUpdated = false;
checkForNewShard(dbObj);
checkNewlySharded(dbObj, currScalarMap);
for (String fieldName : dbObj.getUpdatedFieldNames()) {
FieldUpdater fieldUpdater = Fiel... | java | private boolean updateObjectSameShard(DBObject dbObj, Map<String, String> currScalarMap) {
boolean bUpdated = false;
checkForNewShard(dbObj);
checkNewlySharded(dbObj, currScalarMap);
for (String fieldName : dbObj.getUpdatedFieldNames()) {
FieldUpdater fieldUpdater = Fiel... | [
"private",
"boolean",
"updateObjectSameShard",
"(",
"DBObject",
"dbObj",
",",
"Map",
"<",
"String",
",",
"String",
">",
"currScalarMap",
")",
"{",
"boolean",
"bUpdated",
"=",
"false",
";",
"checkForNewShard",
"(",
"dbObj",
")",
";",
"checkNewlySharded",
"(",
"... | through here. | [
"through",
"here",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L263-L272 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.updateShardedObjectMove | private boolean updateShardedObjectMove(DBObject dbObj) {
DBObject currDBObj = SpiderService.instance().getObject(m_tableDef, dbObj.getObjectID());
m_logger.debug("Update forcing move of object {} from shard {} to shard {}",
new Object[]{dbObj.getObjectID(),
... | java | private boolean updateShardedObjectMove(DBObject dbObj) {
DBObject currDBObj = SpiderService.instance().getObject(m_tableDef, dbObj.getObjectID());
m_logger.debug("Update forcing move of object {} from shard {} to shard {}",
new Object[]{dbObj.getObjectID(),
... | [
"private",
"boolean",
"updateShardedObjectMove",
"(",
"DBObject",
"dbObj",
")",
"{",
"DBObject",
"currDBObj",
"=",
"SpiderService",
".",
"instance",
"(",
")",
".",
"getObject",
"(",
"m_tableDef",
",",
"dbObj",
".",
"getObjectID",
"(",
")",
")",
";",
"m_logger"... | delete the current object, merge the new fields into it, and re-add it. | [
"delete",
"the",
"current",
"object",
"merge",
"the",
"new",
"fields",
"into",
"it",
"and",
"re",
"-",
"add",
"it",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L276-L287 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.objectIsChangingShards | private boolean objectIsChangingShards(DBObject dbObj, Map<String, String> currScalarMap) {
if (!m_tableDef.isSharded()) {
return false;
}
// If object had no prior sharding-field value, it is considered in shard 0.
int oldShardNumber = 0;
String shard... | java | private boolean objectIsChangingShards(DBObject dbObj, Map<String, String> currScalarMap) {
if (!m_tableDef.isSharded()) {
return false;
}
// If object had no prior sharding-field value, it is considered in shard 0.
int oldShardNumber = 0;
String shard... | [
"private",
"boolean",
"objectIsChangingShards",
"(",
"DBObject",
"dbObj",
",",
"Map",
"<",
"String",
",",
"String",
">",
"currScalarMap",
")",
"{",
"if",
"(",
"!",
"m_tableDef",
".",
"isSharded",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"// If obje... | moved to a new shard. | [
"moved",
"to",
"a",
"new",
"shard",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L311-L334 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTConnector.java | RESTConnector.getClient | public RESTClient getClient(SSLTransportParameters sslParams) {
if (m_cellRing == null) {
throw new IllegalStateException("Empty pool");
}
Cell currentCell = m_cellRing;
StringBuilder errorMessage = new StringBuilder();
do {
try {
RESTClient client = new RESTClient(sslParams, m_cellRing.m_ho... | java | public RESTClient getClient(SSLTransportParameters sslParams) {
if (m_cellRing == null) {
throw new IllegalStateException("Empty pool");
}
Cell currentCell = m_cellRing;
StringBuilder errorMessage = new StringBuilder();
do {
try {
RESTClient client = new RESTClient(sslParams, m_cellRing.m_ho... | [
"public",
"RESTClient",
"getClient",
"(",
"SSLTransportParameters",
"sslParams",
")",
"{",
"if",
"(",
"m_cellRing",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Empty pool\"",
")",
";",
"}",
"Cell",
"currentCell",
"=",
"m_cellRing",
"... | Tries to connect to the "next" host. If no host is available,
IllegalStateException will be raised.
@param sslParams parameters needed to establish SSL connection
@return Client for the connection established | [
"Tries",
"to",
"connect",
"to",
"the",
"next",
"host",
".",
"If",
"no",
"host",
"is",
"available",
"IllegalStateException",
"will",
"be",
"raised",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTConnector.java#L143-L166 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTConnector.java | RESTConnector.getState | public Map<String, HostStatus> getState() {
Map<String, HostStatus> map = new HashMap<>();
if (m_cellRing != null) {
Cell currentCell = m_cellRing;
do {
map.put(currentCell.m_hostName, currentCell.m_hostStatus);
currentCell = currentCell.next;
} while (currentCell != m_cellRing);
}
ret... | java | public Map<String, HostStatus> getState() {
Map<String, HostStatus> map = new HashMap<>();
if (m_cellRing != null) {
Cell currentCell = m_cellRing;
do {
map.put(currentCell.m_hostName, currentCell.m_hostStatus);
currentCell = currentCell.next;
} while (currentCell != m_cellRing);
}
ret... | [
"public",
"Map",
"<",
"String",
",",
"HostStatus",
">",
"getState",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"HostStatus",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"if",
"(",
"m_cellRing",
"!=",
"null",
")",
"{",
"Cell",
"currentCell"... | Generates a map of the last state of the attempts of the connections.
Useful in a situation when a getClient method ended in exception, then this
method can show the reasons of refusals.
@return Map of current connection states. | [
"Generates",
"a",
"map",
"of",
"the",
"last",
"state",
"of",
"the",
"attempts",
"of",
"the",
"connections",
".",
"Useful",
"in",
"a",
"situation",
"when",
"a",
"getClient",
"method",
"ended",
"in",
"exception",
"then",
"this",
"method",
"can",
"show",
"the... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTConnector.java#L175-L185 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/RESTConnector.java | RESTConnector.addToRing | private void addToRing(String host) {
Cell newCell = new Cell();
newCell.m_hostName = host;
if (m_cellRing == null) {
newCell.next = newCell;
} else {
newCell.next = m_cellRing.next;
m_cellRing.next = newCell;
}
m_cellRing = newCell;
} | java | private void addToRing(String host) {
Cell newCell = new Cell();
newCell.m_hostName = host;
if (m_cellRing == null) {
newCell.next = newCell;
} else {
newCell.next = m_cellRing.next;
m_cellRing.next = newCell;
}
m_cellRing = newCell;
} | [
"private",
"void",
"addToRing",
"(",
"String",
"host",
")",
"{",
"Cell",
"newCell",
"=",
"new",
"Cell",
"(",
")",
";",
"newCell",
".",
"m_hostName",
"=",
"host",
";",
"if",
"(",
"m_cellRing",
"==",
"null",
")",
"{",
"newCell",
".",
"next",
"=",
"newC... | Adds a new host to a cells ring.
@param host Host name to add | [
"Adds",
"a",
"new",
"host",
"to",
"a",
"cells",
"ring",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/RESTConnector.java#L191-L201 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraTransaction.java | CassandraTransaction.createMutation | private static Mutation createMutation(byte[] colName, byte[] colValue, long timestamp) {
if (colValue == null) {
colValue = EMPTY_BYTES;
}
Column col = new Column();
col.setName(colName);
col.setValue(colValue);
col.setTimestamp(timestamp);
... | java | private static Mutation createMutation(byte[] colName, byte[] colValue, long timestamp) {
if (colValue == null) {
colValue = EMPTY_BYTES;
}
Column col = new Column();
col.setName(colName);
col.setValue(colValue);
col.setTimestamp(timestamp);
... | [
"private",
"static",
"Mutation",
"createMutation",
"(",
"byte",
"[",
"]",
"colName",
",",
"byte",
"[",
"]",
"colValue",
",",
"long",
"timestamp",
")",
"{",
"if",
"(",
"colValue",
"==",
"null",
")",
"{",
"colValue",
"=",
"EMPTY_BYTES",
";",
"}",
"Column",... | Create a Mutation with the given column name and column value | [
"Create",
"a",
"Mutation",
"with",
"the",
"given",
"column",
"name",
"and",
"column",
"value"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraTransaction.java#L119-L134 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraTransaction.java | CassandraTransaction.createDeleteColumnMutation | private static Mutation createDeleteColumnMutation(byte[] colName, long timestamp) {
SlicePredicate slicePred = new SlicePredicate();
slicePred.addToColumn_names(ByteBuffer.wrap(colName));
Deletion deletion = new Deletion();
deletion.setPredicate(slicePred);
deleti... | java | private static Mutation createDeleteColumnMutation(byte[] colName, long timestamp) {
SlicePredicate slicePred = new SlicePredicate();
slicePred.addToColumn_names(ByteBuffer.wrap(colName));
Deletion deletion = new Deletion();
deletion.setPredicate(slicePred);
deleti... | [
"private",
"static",
"Mutation",
"createDeleteColumnMutation",
"(",
"byte",
"[",
"]",
"colName",
",",
"long",
"timestamp",
")",
"{",
"SlicePredicate",
"slicePred",
"=",
"new",
"SlicePredicate",
"(",
")",
";",
"slicePred",
".",
"addToColumn_names",
"(",
"ByteBuffer... | Create a column mutation that deletes the given column name. | [
"Create",
"a",
"column",
"mutation",
"that",
"deletes",
"the",
"given",
"column",
"name",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraTransaction.java#L137-L148 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/olap/collections/NumericUtils.java | NumericUtils.gcd | public static long gcd(long x, long y) {
if(x < 0) x = -x;
if(y < 0) y = -y;
if(x < y) {
long temp = x;
x = y;
y = temp;
}
long gcd = 1;
while(y > 1) {
if((x & 1) == 0) {
if((y & 1) == 0) {
gcd <<= 1;
x >>= 1;
y >>= 1;
} else {
x >>= 1;
}
} else {
if((y & 1... | java | public static long gcd(long x, long y) {
if(x < 0) x = -x;
if(y < 0) y = -y;
if(x < y) {
long temp = x;
x = y;
y = temp;
}
long gcd = 1;
while(y > 1) {
if((x & 1) == 0) {
if((y & 1) == 0) {
gcd <<= 1;
x >>= 1;
y >>= 1;
} else {
x >>= 1;
}
} else {
if((y & 1... | [
"public",
"static",
"long",
"gcd",
"(",
"long",
"x",
",",
"long",
"y",
")",
"{",
"if",
"(",
"x",
"<",
"0",
")",
"x",
"=",
"-",
"x",
";",
"if",
"(",
"y",
"<",
"0",
")",
"y",
"=",
"-",
"y",
";",
"if",
"(",
"x",
"<",
"y",
")",
"{",
"long... | greatest common divisor | [
"greatest",
"common",
"divisor"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/olap/collections/NumericUtils.java#L43-L75 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java | DBConn.getColumn | ColumnOrSuperColumn getColumn(ByteBuffer key, ColumnPath colPath) {
m_logger.debug("Fetching {}.{}", new Object[]{Utils.toString(key), toString(colPath)});
ColumnOrSuperColumn column = null;
boolean bSuccess = false;
for (int attempts = 1; !bSuccess; attempts++) {
try {
... | java | ColumnOrSuperColumn getColumn(ByteBuffer key, ColumnPath colPath) {
m_logger.debug("Fetching {}.{}", new Object[]{Utils.toString(key), toString(colPath)});
ColumnOrSuperColumn column = null;
boolean bSuccess = false;
for (int attempts = 1; !bSuccess; attempts++) {
try {
... | [
"ColumnOrSuperColumn",
"getColumn",
"(",
"ByteBuffer",
"key",
",",
"ColumnPath",
"colPath",
")",
"{",
"m_logger",
".",
"debug",
"(",
"\"Fetching {}.{}\"",
",",
"new",
"Object",
"[",
"]",
"{",
"Utils",
".",
"toString",
"(",
"key",
")",
",",
"toString",
"(",
... | Fetch a single column. | [
"Fetch",
"a",
"single",
"column",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java#L387-L430 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java | DBConn.commitDeletes | private void commitDeletes(DBTransaction dbTran, long timestamp) {
Map<String, Set<ByteBuffer>> rowDeleteMap = CassandraTransaction.getRowDeletionMap(dbTran);
if (rowDeleteMap.size() == 0) {
return;
}
// Iterate through all ColumnFamilies
for (String c... | java | private void commitDeletes(DBTransaction dbTran, long timestamp) {
Map<String, Set<ByteBuffer>> rowDeleteMap = CassandraTransaction.getRowDeletionMap(dbTran);
if (rowDeleteMap.size() == 0) {
return;
}
// Iterate through all ColumnFamilies
for (String c... | [
"private",
"void",
"commitDeletes",
"(",
"DBTransaction",
"dbTran",
",",
"long",
"timestamp",
")",
"{",
"Map",
"<",
"String",
",",
"Set",
"<",
"ByteBuffer",
">",
">",
"rowDeleteMap",
"=",
"CassandraTransaction",
".",
"getRowDeletionMap",
"(",
"dbTran",
")",
";... | Commit all row-deletions in the given MutationMap, if any, using the given timestamp. | [
"Commit",
"all",
"row",
"-",
"deletions",
"in",
"the",
"given",
"MutationMap",
"if",
"any",
"using",
"the",
"given",
"timestamp",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java#L434-L448 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java | DBConn.commitMutations | private void commitMutations(DBTransaction dbTran, long timestamp) {
Map<ByteBuffer, Map<String, List<Mutation>>> colMutMap = CassandraTransaction.getUpdateMap(dbTran, timestamp);
if (colMutMap.size() == 0) {
return;
}
m_logger.debug("Committing {} mutations", CassandraT... | java | private void commitMutations(DBTransaction dbTran, long timestamp) {
Map<ByteBuffer, Map<String, List<Mutation>>> colMutMap = CassandraTransaction.getUpdateMap(dbTran, timestamp);
if (colMutMap.size() == 0) {
return;
}
m_logger.debug("Committing {} mutations", CassandraT... | [
"private",
"void",
"commitMutations",
"(",
"DBTransaction",
"dbTran",
",",
"long",
"timestamp",
")",
"{",
"Map",
"<",
"ByteBuffer",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"Mutation",
">",
">",
">",
"colMutMap",
"=",
"CassandraTransaction",
".",
"getUpd... | configured maximum number of retries. | [
"configured",
"maximum",
"number",
"of",
"retries",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java#L452-L500 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java | DBConn.reconnect | private void reconnect(Exception reconnectEx) {
// Log the exception as a warning.
m_logger.warn("Reconnecting to Cassandra due to error", reconnectEx);
// Reconnect up to the configured number of times, waiting a little between each attempt.
boolean bSuccess = false;
... | java | private void reconnect(Exception reconnectEx) {
// Log the exception as a warning.
m_logger.warn("Reconnecting to Cassandra due to error", reconnectEx);
// Reconnect up to the configured number of times, waiting a little between each attempt.
boolean bSuccess = false;
... | [
"private",
"void",
"reconnect",
"(",
"Exception",
"reconnectEx",
")",
"{",
"// Log the exception as a warning.\r",
"m_logger",
".",
"warn",
"(",
"\"Reconnecting to Cassandra due to error\"",
",",
"reconnectEx",
")",
";",
"// Reconnect up to the configured number of times, waiting... | an DBNotAvailableException and leave the Thrift connection null. | [
"an",
"DBNotAvailableException",
"and",
"leave",
"the",
"Thrift",
"connection",
"null",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java#L518-L544 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java | DBConn.timing | private void timing(String metric, Date startDate) {
m_logger.trace("Time for '{}': {}", metric,
((new Date()).getTime() - startDate.getTime()) + " millis");
} | java | private void timing(String metric, Date startDate) {
m_logger.trace("Time for '{}': {}", metric,
((new Date()).getTime() - startDate.getTime()) + " millis");
} | [
"private",
"void",
"timing",
"(",
"String",
"metric",
",",
"Date",
"startDate",
")",
"{",
"m_logger",
".",
"trace",
"(",
"\"Time for '{}': {}\"",
",",
"metric",
",",
"(",
"(",
"new",
"Date",
"(",
")",
")",
".",
"getTime",
"(",
")",
"-",
"startDate",
".... | milliseconds using the given prefix as a label. | [
"milliseconds",
"using",
"the",
"given",
"prefix",
"as",
"a",
"label",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/DBConn.java#L602-L605 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java | XMLBuilder.startElement | public void startElement(String elemName, String attrName, String attrValue) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", attrName, "", "CDATA", attrValue);
writeStartElement(elemName, attrs);
m_tagStack.push(elemName);
} | java | public void startElement(String elemName, String attrName, String attrValue) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", attrName, "", "CDATA", attrValue);
writeStartElement(elemName, attrs);
m_tagStack.push(elemName);
} | [
"public",
"void",
"startElement",
"(",
"String",
"elemName",
",",
"String",
"attrName",
",",
"String",
"attrValue",
")",
"{",
"AttributesImpl",
"attrs",
"=",
"new",
"AttributesImpl",
"(",
")",
";",
"attrs",
".",
"addAttribute",
"(",
"\"\"",
",",
"attrName",
... | Start a new XML element using the given start tag and single attribute. | [
"Start",
"a",
"new",
"XML",
"element",
"using",
"the",
"given",
"start",
"tag",
"and",
"single",
"attribute",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java#L73-L78 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java | XMLBuilder.startElement | public void startElement(String elemName, Attributes attrs) {
writeStartElement(elemName, attrs);
m_tagStack.push(elemName);
} | java | public void startElement(String elemName, Attributes attrs) {
writeStartElement(elemName, attrs);
m_tagStack.push(elemName);
} | [
"public",
"void",
"startElement",
"(",
"String",
"elemName",
",",
"Attributes",
"attrs",
")",
"{",
"writeStartElement",
"(",
"elemName",
",",
"attrs",
")",
";",
"m_tagStack",
".",
"push",
"(",
"elemName",
")",
";",
"}"
] | Start a new XML element using the given name and attribute set. | [
"Start",
"a",
"new",
"XML",
"element",
"using",
"the",
"given",
"name",
"and",
"attribute",
"set",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java#L81-L84 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java | XMLBuilder.addDataElement | public void addDataElement(String elemName, String content, Attributes attrs) {
writeDataElement(elemName, attrs, content);
} | java | public void addDataElement(String elemName, String content, Attributes attrs) {
writeDataElement(elemName, attrs, content);
} | [
"public",
"void",
"addDataElement",
"(",
"String",
"elemName",
",",
"String",
"content",
",",
"Attributes",
"attrs",
")",
"{",
"writeDataElement",
"(",
"elemName",
",",
"attrs",
",",
"content",
")",
";",
"}"
] | Same as above but using an attribute set. | [
"Same",
"as",
"above",
"but",
"using",
"an",
"attribute",
"set",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java#L112-L114 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java | XMLBuilder.toAttributes | private Attributes toAttributes(Map<String,String> attrs){
AttributesImpl impl = new AttributesImpl();
for (Map.Entry<String,String> attr : attrs.entrySet()){
impl.addAttribute("", attr.getKey(), "", "CDATA", attr.getValue());
}
return impl;
} | java | private Attributes toAttributes(Map<String,String> attrs){
AttributesImpl impl = new AttributesImpl();
for (Map.Entry<String,String> attr : attrs.entrySet()){
impl.addAttribute("", attr.getKey(), "", "CDATA", attr.getValue());
}
return impl;
} | [
"private",
"Attributes",
"toAttributes",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"attrs",
")",
"{",
"AttributesImpl",
"impl",
"=",
"new",
"AttributesImpl",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"attr",
... | Converts attribute map to Attributes class instance. | [
"Converts",
"attribute",
"map",
"to",
"Attributes",
"class",
"instance",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java#L130-L136 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java | ApplicationDefinition.isValidName | public static boolean isValidName(String appName) {
return appName != null &&
appName.length() > 0 &&
Utils.isLetter(appName.charAt(0)) &&
Utils.allAlphaNumUnderscore(appName);
} | java | public static boolean isValidName(String appName) {
return appName != null &&
appName.length() > 0 &&
Utils.isLetter(appName.charAt(0)) &&
Utils.allAlphaNumUnderscore(appName);
} | [
"public",
"static",
"boolean",
"isValidName",
"(",
"String",
"appName",
")",
"{",
"return",
"appName",
"!=",
"null",
"&&",
"appName",
".",
"length",
"(",
")",
">",
"0",
"&&",
"Utils",
".",
"isLetter",
"(",
"appName",
".",
"charAt",
"(",
"0",
")",
")",
... | Test the given string for validity as an application name. A valid application
name must begin with a letter and contain only letters, digits, and underscores.
@param appName Candidate application name.
@return True if name is syntactically valid. | [
"Test",
"the",
"given",
"string",
"for",
"validity",
"as",
"an",
"application",
"name",
".",
"A",
"valid",
"application",
"name",
"must",
"begin",
"with",
"a",
"letter",
"and",
"contain",
"only",
"letters",
"digits",
"and",
"underscores",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java#L58-L63 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java | ApplicationDefinition.parse | public void parse(UNode appNode) {
assert appNode != null;
// Verify application name and save it.
setAppName(appNode.getName());
// Iterate through the application object's members.
for (String childName : appNode.getMemberNames()) {
// See ... | java | public void parse(UNode appNode) {
assert appNode != null;
// Verify application name and save it.
setAppName(appNode.getName());
// Iterate through the application object's members.
for (String childName : appNode.getMemberNames()) {
// See ... | [
"public",
"void",
"parse",
"(",
"UNode",
"appNode",
")",
"{",
"assert",
"appNode",
"!=",
"null",
";",
"// Verify application name and save it.\r",
"setAppName",
"(",
"appNode",
".",
"getName",
"(",
")",
")",
";",
"// Iterate through the application object's members.\r",... | Parse the application definition rooted at given UNode tree and copy its contents
into this object. The root node is the "application" object, so its name is the
application name and its child nodes are definitions such as "key", "options",
"fields", etc. An exception is thrown if the definition contains an error.
@pa... | [
"Parse",
"the",
"application",
"definition",
"rooted",
"at",
"given",
"UNode",
"tree",
"and",
"copy",
"its",
"contents",
"into",
"this",
"object",
".",
"The",
"root",
"node",
"is",
"the",
"application",
"object",
"so",
"its",
"name",
"is",
"the",
"applicatio... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java#L79-L132 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java | ApplicationDefinition.allowsAutoTables | public boolean allowsAutoTables() {
String optValue = getOption(CommonDefs.AUTO_TABLES);
return optValue != null && optValue.equalsIgnoreCase("true");
} | java | public boolean allowsAutoTables() {
String optValue = getOption(CommonDefs.AUTO_TABLES);
return optValue != null && optValue.equalsIgnoreCase("true");
} | [
"public",
"boolean",
"allowsAutoTables",
"(",
")",
"{",
"String",
"optValue",
"=",
"getOption",
"(",
"CommonDefs",
".",
"AUTO_TABLES",
")",
";",
"return",
"optValue",
"!=",
"null",
"&&",
"optValue",
".",
"equalsIgnoreCase",
"(",
"\"true\"",
")",
";",
"}"
] | Indicate whether or not this application tables to be implicitly created.
@return True if this application tables to be implicitly created. | [
"Indicate",
"whether",
"or",
"not",
"this",
"application",
"tables",
"to",
"be",
"implicitly",
"created",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java#L164-L167 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java | ApplicationDefinition.setOption | public void setOption(String optName, String optValue) {
if (optValue == null) {
m_optionMap.remove(optName);
} else {
m_optionMap.put(optName, optValue.trim());
}
} | java | public void setOption(String optName, String optValue) {
if (optValue == null) {
m_optionMap.remove(optName);
} else {
m_optionMap.put(optName, optValue.trim());
}
} | [
"public",
"void",
"setOption",
"(",
"String",
"optName",
",",
"String",
"optValue",
")",
"{",
"if",
"(",
"optValue",
"==",
"null",
")",
"{",
"m_optionMap",
".",
"remove",
"(",
"optName",
")",
";",
"}",
"else",
"{",
"m_optionMap",
".",
"put",
"(",
"optN... | Set the option with the given name to the given value. If the option value is null,
the option is "unset". If the option has an existing value, it is replaced.
@param optName Name of option to set (case-sensitive).
@param optValue New value of option or null to "unset". | [
"Set",
"the",
"option",
"with",
"the",
"given",
"name",
"to",
"the",
"given",
"value",
".",
"If",
"the",
"option",
"value",
"is",
"null",
"the",
"option",
"is",
"unset",
".",
"If",
"the",
"option",
"has",
"an",
"existing",
"value",
"it",
"is",
"replace... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java#L302-L308 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java | ApplicationDefinition.removeTableDef | public void removeTableDef(TableDefinition tableDef) {
assert tableDef != null;
assert tableDef.getAppDef() == this;
m_tableMap.remove(tableDef.getTableName());
} | java | public void removeTableDef(TableDefinition tableDef) {
assert tableDef != null;
assert tableDef.getAppDef() == this;
m_tableMap.remove(tableDef.getTableName());
} | [
"public",
"void",
"removeTableDef",
"(",
"TableDefinition",
"tableDef",
")",
"{",
"assert",
"tableDef",
"!=",
"null",
";",
"assert",
"tableDef",
".",
"getAppDef",
"(",
")",
"==",
"this",
";",
"m_tableMap",
".",
"remove",
"(",
"tableDef",
".",
"getTableName",
... | Remove the given table from this application, presumably because it has been
deleted.
@param tableDef {@link TableDefinition} to be deleted. | [
"Remove",
"the",
"given",
"table",
"from",
"this",
"application",
"presumably",
"because",
"it",
"has",
"been",
"deleted",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java#L339-L344 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java | ApplicationDefinition.verify | private void verify() {
// Copy table defs to avoid ConcurrentModificationException if we add a table.
List<TableDefinition> definedTables = new ArrayList<>(m_tableMap.values());
for (TableDefinition tableDef : definedTables) {
// Copy field defs for same reason
List... | java | private void verify() {
// Copy table defs to avoid ConcurrentModificationException if we add a table.
List<TableDefinition> definedTables = new ArrayList<>(m_tableMap.values());
for (TableDefinition tableDef : definedTables) {
// Copy field defs for same reason
List... | [
"private",
"void",
"verify",
"(",
")",
"{",
"// Copy table defs to avoid ConcurrentModificationException if we add a table.\r",
"List",
"<",
"TableDefinition",
">",
"definedTables",
"=",
"new",
"ArrayList",
"<>",
"(",
"m_tableMap",
".",
"values",
"(",
")",
")",
";",
"... | complete and in agreement. | [
"complete",
"and",
"in",
"agreement",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java#L435-L447 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java | ApplicationDefinition.verifyLink | private void verifyLink(TableDefinition tableDef, FieldDefinition linkDef) {
String extent = linkDef.getLinkExtent();
TableDefinition extentTableDef = getTableDef(extent);
if (extentTableDef == null) {
extentTableDef = new TableDefinition();
extentTableDef.setTableNa... | java | private void verifyLink(TableDefinition tableDef, FieldDefinition linkDef) {
String extent = linkDef.getLinkExtent();
TableDefinition extentTableDef = getTableDef(extent);
if (extentTableDef == null) {
extentTableDef = new TableDefinition();
extentTableDef.setTableNa... | [
"private",
"void",
"verifyLink",
"(",
"TableDefinition",
"tableDef",
",",
"FieldDefinition",
"linkDef",
")",
"{",
"String",
"extent",
"=",
"linkDef",
".",
"getLinkExtent",
"(",
")",
";",
"TableDefinition",
"extentTableDef",
"=",
"getTableDef",
"(",
"extent",
")",
... | has not been defined, add it automatically. | [
"has",
"not",
"been",
"defined",
"add",
"it",
"automatically",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java#L452-L477 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java | ApplicationDefinition.replaceAliaces | public String replaceAliaces(String str) {
if(str == null) return str;
// for performance
if(str.indexOf(CommonDefs.ALIAS_FIRST_CHAR) < 0) return str;
PriorityQueue<AliasDefinition> aliasQueue = new PriorityQueue<AliasDefinition>(11, new Comparator<AliasDefinition>() {
public int compare(AliasDefini... | java | public String replaceAliaces(String str) {
if(str == null) return str;
// for performance
if(str.indexOf(CommonDefs.ALIAS_FIRST_CHAR) < 0) return str;
PriorityQueue<AliasDefinition> aliasQueue = new PriorityQueue<AliasDefinition>(11, new Comparator<AliasDefinition>() {
public int compare(AliasDefini... | [
"public",
"String",
"replaceAliaces",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"return",
"str",
";",
"// for performance\r",
"if",
"(",
"str",
".",
"indexOf",
"(",
"CommonDefs",
".",
"ALIAS_FIRST_CHAR",
")",
"<",
"0",
")",
"re... | Replaces of all occurences of aliases defined with this table, by their expressions.
Now a simple string.replace is used.
@param str string to replace
@return string with replaced aliases. If there were no aliases, the string is unchanged. | [
"Replaces",
"of",
"all",
"occurences",
"of",
"aliases",
"defined",
"with",
"this",
"table",
"by",
"their",
"expressions",
".",
"Now",
"a",
"simple",
"string",
".",
"replace",
"is",
"used",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/ApplicationDefinition.java#L486-L512 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/mbeans/MBeanBase.java | MBeanBase.register | public void register() {
try {
objectName = consObjectName(domain, type, keysString);
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
mbs.registerMBean(this, objectName);
} catch (Exception e) {
objectName = null;
throw new RuntimeException(e);
}
} | java | public void register() {
try {
objectName = consObjectName(domain, type, keysString);
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
mbs.registerMBean(this, objectName);
} catch (Exception e) {
objectName = null;
throw new RuntimeException(e);
}
} | [
"public",
"void",
"register",
"(",
")",
"{",
"try",
"{",
"objectName",
"=",
"consObjectName",
"(",
"domain",
",",
"type",
",",
"keysString",
")",
";",
"MBeanServer",
"mbs",
"=",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
";",
"mbs",
".",
... | Registers this bean on platform MBeanServer. | [
"Registers",
"this",
"bean",
"on",
"platform",
"MBeanServer",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/mbeans/MBeanBase.java#L45-L54 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/mbeans/MBeanBase.java | MBeanBase.deregister | public void deregister() {
if(objectName == null) {
return;
}
try {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
if (mbs.isRegistered(objectName)) {
mbs.unregisterMBean(objectName);
}
objectName = null;
} catch (Exception e) {
throw new RuntimeException(e);
... | java | public void deregister() {
if(objectName == null) {
return;
}
try {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
if (mbs.isRegistered(objectName)) {
mbs.unregisterMBean(objectName);
}
objectName = null;
} catch (Exception e) {
throw new RuntimeException(e);
... | [
"public",
"void",
"deregister",
"(",
")",
"{",
"if",
"(",
"objectName",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"MBeanServer",
"mbs",
"=",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
";",
"if",
"(",
"mbs",
".",
"isRegist... | Deregisters this bean on platform MBeanServer. | [
"Deregisters",
"this",
"bean",
"on",
"platform",
"MBeanServer",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/mbeans/MBeanBase.java#L59-L73 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/mbeans/MBeanBase.java | MBeanBase.consObjectName | protected ObjectName consObjectName(String domain, String type,
String keysString) {
String d = domain != null && !"".equals(domain) ? domain
: getDefaultDomain();
String t = type != null && !"".equals(type) ? type : getDefaultType();
String k = keysString != null && !"".equals(keysString) ? ","
... | java | protected ObjectName consObjectName(String domain, String type,
String keysString) {
String d = domain != null && !"".equals(domain) ? domain
: getDefaultDomain();
String t = type != null && !"".equals(type) ? type : getDefaultType();
String k = keysString != null && !"".equals(keysString) ? ","
... | [
"protected",
"ObjectName",
"consObjectName",
"(",
"String",
"domain",
",",
"String",
"type",
",",
"String",
"keysString",
")",
"{",
"String",
"d",
"=",
"domain",
"!=",
"null",
"&&",
"!",
"\"\"",
".",
"equals",
"(",
"domain",
")",
"?",
"domain",
":",
"get... | Constructs the ObjectName of bean.
@param domain
The domain part in object name of bean. It is a string of
characters not including the character colon (:), wildcard
characters asterisk (*), and question mark (?). It is
recommended that the domain should not contain the string "//"
also. If the domain is null or empty... | [
"Constructs",
"the",
"ObjectName",
"of",
"bean",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/mbeans/MBeanBase.java#L96-L109 | train |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/JSONAnnie.java | JSONAnnie.push | private void push(Construct construct) {
// Make sure we don't blow the stack.
check(m_stackPos < MAX_STACK_DEPTH, "Too many JSON nested levels (maximum=" + MAX_STACK_DEPTH + ")");
m_stack[m_stackPos++] = construct;
} | java | private void push(Construct construct) {
// Make sure we don't blow the stack.
check(m_stackPos < MAX_STACK_DEPTH, "Too many JSON nested levels (maximum=" + MAX_STACK_DEPTH + ")");
m_stack[m_stackPos++] = construct;
} | [
"private",
"void",
"push",
"(",
"Construct",
"construct",
")",
"{",
"// Make sure we don't blow the stack.\r",
"check",
"(",
"m_stackPos",
"<",
"MAX_STACK_DEPTH",
",",
"\"Too many JSON nested levels (maximum=\"",
"+",
"MAX_STACK_DEPTH",
"+",
"\")\"",
")",
";",
"m_stack",
... | Push the given node onto the node stack. | [
"Push",
"the",
"given",
"node",
"onto",
"the",
"node",
"stack",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/JSONAnnie.java#L532-L536 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java | Command.call | public RESTResponse call(RESTClient restClient){
String methodName = getMethod();
String uri = getURI();
StringBuilder uriBuilder = new StringBuilder(Utils.isEmpty(restClient.getApiPrefix()) ? "" : "/" + restClient.getApiPrefix());
uriBuilder.append(substitute(uri)); ... | java | public RESTResponse call(RESTClient restClient){
String methodName = getMethod();
String uri = getURI();
StringBuilder uriBuilder = new StringBuilder(Utils.isEmpty(restClient.getApiPrefix()) ? "" : "/" + restClient.getApiPrefix());
uriBuilder.append(substitute(uri)); ... | [
"public",
"RESTResponse",
"call",
"(",
"RESTClient",
"restClient",
")",
"{",
"String",
"methodName",
"=",
"getMethod",
"(",
")",
";",
"String",
"uri",
"=",
"getURI",
"(",
")",
";",
"StringBuilder",
"uriBuilder",
"=",
"new",
"StringBuilder",
"(",
"Utils",
"."... | Call method implementation
@param restClient
@return RESTResponse result object | [
"Call",
"method",
"implementation"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java#L111-L125 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java | Command.validate | public void validate(RESTClient restClient) {
Utils.require(this.commandName != null, "missing command name");
//validate command name
this.metadataJson = matchCommand(restMetadataJson, this.commandName, commandParams.containsKey(STORAGE_SERVICE) ? (String)commandParams.get(STORAGE_SER... | java | public void validate(RESTClient restClient) {
Utils.require(this.commandName != null, "missing command name");
//validate command name
this.metadataJson = matchCommand(restMetadataJson, this.commandName, commandParams.containsKey(STORAGE_SERVICE) ? (String)commandParams.get(STORAGE_SER... | [
"public",
"void",
"validate",
"(",
"RESTClient",
"restClient",
")",
"{",
"Utils",
".",
"require",
"(",
"this",
".",
"commandName",
"!=",
"null",
",",
"\"missing command name\"",
")",
";",
"//validate command name ",
"this",
".",
"metadataJson",
"=",
"matchCommand"... | Validate the command
@param restClient | [
"Validate",
"the",
"command"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java#L132-L148 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java | Command.validateRequiredParams | private void validateRequiredParams() {
String[] uriStrings = getURI().split("\\?");
if (uriStrings.length > 0) {
List<String> requiredParms = extractRequiredParamsInURI(uriStrings[0]);
for (String param: requiredParms) {
Utils.require(commandParams.containsKey(param),... | java | private void validateRequiredParams() {
String[] uriStrings = getURI().split("\\?");
if (uriStrings.length > 0) {
List<String> requiredParms = extractRequiredParamsInURI(uriStrings[0]);
for (String param: requiredParms) {
Utils.require(commandParams.containsKey(param),... | [
"private",
"void",
"validateRequiredParams",
"(",
")",
"{",
"String",
"[",
"]",
"uriStrings",
"=",
"getURI",
"(",
")",
".",
"split",
"(",
"\"\\\\?\"",
")",
";",
"if",
"(",
"uriStrings",
".",
"length",
">",
"0",
")",
"{",
"List",
"<",
"String",
">",
"... | Validate Required Params | [
"Validate",
"Required",
"Params"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java#L154-L184 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java | Command.extractRequiredParamsInURI | private List<String> extractRequiredParamsInURI(String uri) {
List<String> matchList = new ArrayList<String>();
Pattern regex = Pattern.compile("\\{(.*?)\\}");
Matcher regexMatcher = regex.matcher(uri);
while (regexMatcher.find()) {
matchList.add(regexMatcher.group(1));
}
... | java | private List<String> extractRequiredParamsInURI(String uri) {
List<String> matchList = new ArrayList<String>();
Pattern regex = Pattern.compile("\\{(.*?)\\}");
Matcher regexMatcher = regex.matcher(uri);
while (regexMatcher.find()) {
matchList.add(regexMatcher.group(1));
}
... | [
"private",
"List",
"<",
"String",
">",
"extractRequiredParamsInURI",
"(",
"String",
"uri",
")",
"{",
"List",
"<",
"String",
">",
"matchList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Pattern",
"regex",
"=",
"Pattern",
".",
"compile",
... | Extract Required Params In URI
@param uri
@return the list of required params | [
"Extract",
"Required",
"Params",
"In",
"URI"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java#L191-L199 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java | Command.substitute | private String substitute(String uri) {
List<String> params = extractRequiredParamsInURI(uri);
for (String param: params) {
if (param.equals(PARAMS)) {
uri = uri.replace("{" + PARAMS +"}", Utils.urlEncode(getParamsURI()));
}
else {
uri = uri.replace("{" + param + "}", (String)c... | java | private String substitute(String uri) {
List<String> params = extractRequiredParamsInURI(uri);
for (String param: params) {
if (param.equals(PARAMS)) {
uri = uri.replace("{" + PARAMS +"}", Utils.urlEncode(getParamsURI()));
}
else {
uri = uri.replace("{" + param + "}", (String)c... | [
"private",
"String",
"substitute",
"(",
"String",
"uri",
")",
"{",
"List",
"<",
"String",
">",
"params",
"=",
"extractRequiredParamsInURI",
"(",
"uri",
")",
";",
"for",
"(",
"String",
"param",
":",
"params",
")",
"{",
"if",
"(",
"param",
".",
"equals",
... | Substitute the params with values submittted via command builder
@param uri the uri string
@return the uri string after substitution | [
"Substitute",
"the",
"params",
"with",
"values",
"submittted",
"via",
"command",
"builder"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java#L207-L218 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java | Command.getBody | private byte[] getBody(String method) {
byte[] body = null;
String methodsWithInputEntity = HttpMethod.POST.name() + "|" + HttpMethod.PUT.name() + "|" + HttpMethod.DELETE.name();
if (method.matches(methodsWithInputEntity)) {
if (isCompound()) {
body = Utils.toBytes(getQuery... | java | private byte[] getBody(String method) {
byte[] body = null;
String methodsWithInputEntity = HttpMethod.POST.name() + "|" + HttpMethod.PUT.name() + "|" + HttpMethod.DELETE.name();
if (method.matches(methodsWithInputEntity)) {
if (isCompound()) {
body = Utils.toBytes(getQuery... | [
"private",
"byte",
"[",
"]",
"getBody",
"(",
"String",
"method",
")",
"{",
"byte",
"[",
"]",
"body",
"=",
"null",
";",
"String",
"methodsWithInputEntity",
"=",
"HttpMethod",
".",
"POST",
".",
"name",
"(",
")",
"+",
"\"|\"",
"+",
"HttpMethod",
".",
"PUT... | Build the body for request
@param method
@return | [
"Build",
"the",
"body",
"for",
"request"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java#L226-L243 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java | Command.sendRequest | private RESTResponse sendRequest(RESTClient restClient, String methodName,
String uri, byte[] body) throws IOException {
RESTResponse response = restClient.sendRequest(HttpMethod.methodFromString(methodName),
uri, ContentType.APPLICATION_JSON, ... | java | private RESTResponse sendRequest(RESTClient restClient, String methodName,
String uri, byte[] body) throws IOException {
RESTResponse response = restClient.sendRequest(HttpMethod.methodFromString(methodName),
uri, ContentType.APPLICATION_JSON, ... | [
"private",
"RESTResponse",
"sendRequest",
"(",
"RESTClient",
"restClient",
",",
"String",
"methodName",
",",
"String",
"uri",
",",
"byte",
"[",
"]",
"body",
")",
"throws",
"IOException",
"{",
"RESTResponse",
"response",
"=",
"restClient",
".",
"sendRequest",
"("... | Make RESTful calls to Doradus server
@param restClient
@param methodName
@param uri
@param body
@return
@throws IOException | [
"Make",
"RESTful",
"calls",
"to",
"Doradus",
"server"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java#L255-L261 | train |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java | Command.matchCommand | public static JsonObject matchCommand(JsonObject commandsJson, String commandName, String storageService) {
for (String key : commandsJson.keySet()) {
if (key.equals(storageService)) {
JsonObject commandCats = commandsJson.getJsonObject(key);
if (commandCats.contains... | java | public static JsonObject matchCommand(JsonObject commandsJson, String commandName, String storageService) {
for (String key : commandsJson.keySet()) {
if (key.equals(storageService)) {
JsonObject commandCats = commandsJson.getJsonObject(key);
if (commandCats.contains... | [
"public",
"static",
"JsonObject",
"matchCommand",
"(",
"JsonObject",
"commandsJson",
",",
"String",
"commandName",
",",
"String",
"storageService",
")",
"{",
"for",
"(",
"String",
"key",
":",
"commandsJson",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"key... | Finds out if a command is supported by Doradus
@param commandsJson
@param commandName
@param storageService
@return | [
"Finds",
"out",
"if",
"a",
"command",
"is",
"supported",
"by",
"Doradus"
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/dory/command/Command.java#L270-L280 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java | SchemaService.defineApplication | public void defineApplication(ApplicationDefinition appDef) {
checkServiceState();
Tenant tenant = TenantService.instance().getDefaultTenant();
defineApplication(tenant, appDef);
} | java | public void defineApplication(ApplicationDefinition appDef) {
checkServiceState();
Tenant tenant = TenantService.instance().getDefaultTenant();
defineApplication(tenant, appDef);
} | [
"public",
"void",
"defineApplication",
"(",
"ApplicationDefinition",
"appDef",
")",
"{",
"checkServiceState",
"(",
")",
";",
"Tenant",
"tenant",
"=",
"TenantService",
".",
"instance",
"(",
")",
".",
"getDefaultTenant",
"(",
")",
";",
"defineApplication",
"(",
"t... | Create the application with the given name in the default tenant. If the given
application already exists, the request is treated as an application update. If the
update is successfully validated, its schema is stored in the database, and the
appropriate storage service is notified to implement required physical databa... | [
"Create",
"the",
"application",
"with",
"the",
"given",
"name",
"in",
"the",
"default",
"tenant",
".",
"If",
"the",
"given",
"application",
"already",
"exists",
"the",
"request",
"is",
"treated",
"as",
"an",
"application",
"update",
".",
"If",
"the",
"update... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java#L117-L121 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java | SchemaService.defineApplication | public void defineApplication(Tenant tenant, ApplicationDefinition appDef) {
checkServiceState();
appDef.setTenantName(tenant.getName());
ApplicationDefinition currAppDef = checkApplicationKey(appDef);
StorageService storageService = verifyStorageServiceOption(currAppDef, appDef);
... | java | public void defineApplication(Tenant tenant, ApplicationDefinition appDef) {
checkServiceState();
appDef.setTenantName(tenant.getName());
ApplicationDefinition currAppDef = checkApplicationKey(appDef);
StorageService storageService = verifyStorageServiceOption(currAppDef, appDef);
... | [
"public",
"void",
"defineApplication",
"(",
"Tenant",
"tenant",
",",
"ApplicationDefinition",
"appDef",
")",
"{",
"checkServiceState",
"(",
")",
";",
"appDef",
".",
"setTenantName",
"(",
"tenant",
".",
"getName",
"(",
")",
")",
";",
"ApplicationDefinition",
"cur... | Create the application with the given name in the given Tenant. If the given
application already exists, the request is treated as an application update. If the
update is successfully validated, its schema is stored in the database, and the
appropriate storage service is notified to implement required physical database... | [
"Create",
"the",
"application",
"with",
"the",
"given",
"name",
"in",
"the",
"given",
"Tenant",
".",
"If",
"the",
"given",
"application",
"already",
"exists",
"the",
"request",
"is",
"treated",
"as",
"an",
"application",
"update",
".",
"If",
"the",
"update",... | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java#L134-L141 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java | SchemaService.checkTenants | private void checkTenants() {
m_logger.info("The following tenants and applications are defined:");
Collection<Tenant> tenantList = TenantService.instance().getTenants();
for (Tenant tenant : tenantList) {
checkTenantApps(tenant);
}
if (tenantList.size() == 0) {... | java | private void checkTenants() {
m_logger.info("The following tenants and applications are defined:");
Collection<Tenant> tenantList = TenantService.instance().getTenants();
for (Tenant tenant : tenantList) {
checkTenantApps(tenant);
}
if (tenantList.size() == 0) {... | [
"private",
"void",
"checkTenants",
"(",
")",
"{",
"m_logger",
".",
"info",
"(",
"\"The following tenants and applications are defined:\"",
")",
";",
"Collection",
"<",
"Tenant",
">",
"tenantList",
"=",
"TenantService",
".",
"instance",
"(",
")",
".",
"getTenants",
... | Check to the applications for this tenant. | [
"Check",
"to",
"the",
"applications",
"for",
"this",
"tenant",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java#L286-L295 | train |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java | SchemaService.checkTenantApps | private void checkTenantApps(Tenant tenant) {
m_logger.info(" Tenant: {}", tenant.getName());
try {
Iterator<DRow> rowIter =
DBService.instance(tenant).getAllRows(SchemaService.APPS_STORE_NAME).iterator();
if (!rowIter.hasNext()) {
m_logger... | java | private void checkTenantApps(Tenant tenant) {
m_logger.info(" Tenant: {}", tenant.getName());
try {
Iterator<DRow> rowIter =
DBService.instance(tenant).getAllRows(SchemaService.APPS_STORE_NAME).iterator();
if (!rowIter.hasNext()) {
m_logger... | [
"private",
"void",
"checkTenantApps",
"(",
"Tenant",
"tenant",
")",
"{",
"m_logger",
".",
"info",
"(",
"\" Tenant: {}\"",
",",
"tenant",
".",
"getName",
"(",
")",
")",
";",
"try",
"{",
"Iterator",
"<",
"DRow",
">",
"rowIter",
"=",
"DBService",
".",
"in... | Check that this tenant, its applications, and storage managers are available. | [
"Check",
"that",
"this",
"tenant",
"its",
"applications",
"and",
"storage",
"managers",
"are",
"available",
"."
] | ad64d3c37922eefda68ec8869ef089c1ca604b70 | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java#L298-L325 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.