From c11d067027ad0eadcfd55a2ac9da5a1222ad2e5f Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 16 Aug 2019 08:42:03 +0900 Subject: [PATCH] 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 --- .../storlet/daemon/SDescriptorTask.java | 67 ------------------- .../storlet/daemon/STaskFactory.java | 55 --------------- storlets/sbus/command.py | 1 - 3 files changed, 123 deletions(-) delete mode 100644 src/java/SDaemon/src/main/org/openstack/storlet/daemon/SDescriptorTask.java diff --git a/src/java/SDaemon/src/main/org/openstack/storlet/daemon/SDescriptorTask.java b/src/java/SDaemon/src/main/org/openstack/storlet/daemon/SDescriptorTask.java deleted file mode 100644 index 22d31e3e..00000000 --- a/src/java/SDaemon/src/main/org/openstack/storlet/daemon/SDescriptorTask.java +++ /dev/null @@ -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 =============================== */ diff --git a/src/java/SDaemon/src/main/org/openstack/storlet/daemon/STaskFactory.java b/src/java/SDaemon/src/main/org/openstack/storlet/daemon/STaskFactory.java index 4e0109da..25438c64 100644 --- a/src/java/SDaemon/src/main/org/openstack/storlet/daemon/STaskFactory.java +++ b/src/java/SDaemon/src/main/org/openstack/storlet/daemon/STaskFactory.java @@ -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; diff --git a/storlets/sbus/command.py b/storlets/sbus/command.py index ad72f59a..d6e95823 100644 --- a/storlets/sbus/command.py +++ b/storlets/sbus/command.py @@ -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'