Drop SBUS_CMD_DESCRIPTOR

SBUS_CMD_DESCRIPTOR was implemented in java SDaemon, but
we have never used it.
This patch drop that sbus command, as it is never used and
tested.

Change-Id: Iac92e598ddaa027b9882fbcb8be8ff9738226801
This commit is contained in:
Takashi Kajinami 2019-08-16 08:42:03 +09:00
parent fa433a44c1
commit c11d067027
3 changed files with 0 additions and 123 deletions

View File

@ -1,67 +0,0 @@
/*----------------------------------------------------------------------------
* Copyright IBM Corp. 2015, 2015 All Rights Reserved
* Copyright (c) 2010-2016 OpenStack Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* Limitations under the License.
* ---------------------------------------------------------------------------
*/
package org.openstack.storlet.daemon;
import org.slf4j.Logger;
import org.openstack.storlet.common.*;
/*----------------------------------------------------------------------------
* SDescriptorTask
*
* */
public class SDescriptorTask extends SAbstractTask {
private ObjectRequestsTable requestsTable_ = null;
private StorletObjectOutputStream objStream_ = null;
private String strKey_ = null;
/*------------------------------------------------------------------------
* CTOR
* */
public SDescriptorTask(StorletObjectOutputStream objStream,
final String key, ObjectRequestsTable requestsTable, Logger logger) {
super(logger);
this.requestsTable_ = requestsTable;
this.objStream_ = objStream;
this.strKey_ = key;
}
/*------------------------------------------------------------------------
* exec
* */
@Override
public boolean exec() {
boolean bStatus = true;
logger.trace("StorletDescriptorTask: " + "exec going to extract key "
+ strKey_);
ObjectRequestEntry entry = requestsTable_.Get(strKey_);
logger.trace("StorletDescriptorTask: " + "exec got entry "
+ entry.toString());
try {
logger.trace("StorletDescriptorTask: "
+ "run puttting the obj stream in the entry ");
entry.put(objStream_);
logger.trace("StorletDescriptorTask: "
+ "run obj stream is in the table ");
} catch (InterruptedException e) {
logger.error("InterruptedException while putting obj stream");
bStatus = false;
}
return bStatus;
}
}
/* ============================== END OF FILE =============================== */

View File

@ -62,10 +62,6 @@ public class STaskFactory {
this.logger_.trace("createStorletTask: "
+ "received EXECUTE command");
ResObj = createExecutionTask(dtg, sExecManager);
} else if (command.equals("SBUS_CMD_DESCRIPTOR")) {
this.logger_.trace("createStorletTask: "
+ "received Descriptor command");
ResObj = createDescriptorTask(dtg);
} else if (command.equals("SBUS_CMD_PING")) {
this.logger_.trace("createStorletTask: "
+ "received Ping command");
@ -155,57 +151,6 @@ public class STaskFactory {
dtg.getExecParams(), storletLogger, logger_, sExecManager);
}
private SDescriptorTask createDescriptorTask(ServerSBusInDatagram dtg) {
SDescriptorTask ResObj = null;
String strKey = "";
boolean bStatus = true;
if (2 != dtg.getNFiles()) {
this.logger_.error("createDescriptorTask: "
+ "Wrong fd count for descriptor command. "
+ "Expected 2, got " + dtg.getNFiles());
bStatus = false;
}
this.logger_.trace("createDescriptorTask: #FDs is good");
if (bStatus) {
strKey = dtg.getExecParams().get("key");
if (null == strKey) {
this.logger_.error("createDescriptorTask: "
+ "No key in params");
bStatus = false;
}
this.logger_.trace("createDescriptorTask: key is good");
}
if (bStatus) {
// type is a metadata field used internally, and it should not
// make it further to the Storlet invocation
String strFDType = dtg.getFilesMetadata()[0].get("storlets").get("type");
if (!strFDType.equals("SBUS_FD_OUTPUT_OBJECT")) {
this.logger_.error("createDescriptorTask: "
+ "Wrong fd type for descriptor command. "
+ "Expected SBUS_FD_OUTPUT_OBJECT " + " got "
+ strFDType);
bStatus = false;
}
this.logger_.trace("createStorletTask: "
+ "fd metadata is good. Creating object stream");
}
if (bStatus) {
StorletObjectOutputStream objStream = new StorletObjectOutputStream(
dtg.getFiles()[0], dtg.getFilesMetadata()[0].get("storage"),
dtg.getFiles()[1]);
// parse descriptor stuff
this.logger_.trace("createStorletTask: "
+ "Returning StorletDescriptorTask");
ResObj = new SDescriptorTask(objStream, strKey, requestsTable_,
logger_);
}
return ResObj;
}
private SCancelTask createCancelTask(
ServerSBusInDatagram dtg, SExecutionManager sExecManager) {
SCancelTask ResObj = null;

View File

@ -22,6 +22,5 @@ SBUS_CMD_STOP_DAEMON = 'SBUS_CMD_STOP_DAEMON'
SBUS_CMD_DAEMON_STATUS = 'SBUS_CMD_DAEMON_STATUS'
SBUS_CMD_STOP_DAEMONS = 'SBUS_CMD_STOP_DAEMONS'
SBUS_CMD_PING = 'SBUS_CMD_PING'
SBUS_CMD_DESCRIPTOR = 'SBUS_CMD_DESCRIPTOR'
SBUS_CMD_CANCEL = 'SBUS_CMD_CANCEL'
SBUS_CMD_NOP = 'SBUS_CMD_NOP'