Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement "openio container purge" command, remove unused code #1250

Merged
merged 3 commits into from
Nov 2, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion meta2v2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ add_executable(meta2_server
meta2_filters_extract.c
meta2_filters_check.c
meta2_filters_misc.c
meta2_filters_action_url.c
meta2_filters_action_container.c
meta2_filters_action_content.c
meta2_filter_context.c
Expand Down
66 changes: 0 additions & 66 deletions meta2v2/meta2_filters_action_url.c

This file was deleted.

11 changes: 1 addition & 10 deletions meta2v2/meta2_gridd_dispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ static gridd_filter M2V2_PURGE_FILTERS[] =
meta2_filter_check_ns_name,
meta2_filter_check_ns_is_master,
meta2_filter_action_purge_container,
meta2_filter_reply_success,
NULL
};

Expand Down Expand Up @@ -396,14 +397,6 @@ static gridd_filter M2V2_PROPDEL_FILTERS[] =
NULL
};

static gridd_filter M2V2_EXITELECTION_FILTERS[] =
{
meta2_filter_extract_header_url,
meta2_filter_action_exit_election,
meta2_filter_reply_success,
NULL
};

static gridd_filter M2V2_RAW_DEL_filters[] =
{
meta2_filter_extract_header_url,
Expand Down Expand Up @@ -522,8 +515,6 @@ meta2_gridd_get_v2_requests(void)
{NAME_MSGNAME_M2V2_RAW_ADD, (hook) meta2_dispatch_all, M2V2_RAW_ADD_filters},
{NAME_MSGNAME_M2V2_RAW_SUBST, (hook) meta2_dispatch_all, M2V2_RAW_SUBST_filters},

{NAME_MSGNAME_M2V2_EXITELECTION, (hook) meta2_dispatch_all, M2V2_EXITELECTION_FILTERS},

/* AGENT EVENTS */
{NAME_MSGNAME_M2V1_TOUCH_CONTAINER, (hook) meta2_dispatch_all, M2V2_FILTERS_touch_container},
{NAME_MSGNAME_M2V1_TOUCH_CONTENT, (hook) meta2_dispatch_all, M2V2_FILTERS_touch_content},
Expand Down
1 change: 0 additions & 1 deletion meta2v2/meta2_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define NAME_MSGNAME_M2V2_RAW_DEL "M2_RAWDEL"
# define NAME_MSGNAME_M2V2_RAW_ADD "M2_RAWADD"
# define NAME_MSGNAME_M2V2_RAW_SUBST "M2_RAWSUBST"
# define NAME_MSGNAME_M2V2_EXITELECTION "M2_LEAVE"
# define NAME_MSGNAME_M2V1_TOUCH_CONTENT "M2_CTOUCH"
# define NAME_MSGNAME_M2V1_TOUCH_CONTAINER "M2_BTOUCH"

Expand Down
23 changes: 23 additions & 0 deletions oio/cli/container/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,29 @@ def take_action(self, parsed_args):
return zip(*sorted(info.iteritems()))


class PurgeContainer(command.Command):
"""Purge exceeding object versions."""

log = getLogger(__name__ + '.PurgeContainer')

def get_parser(self, prog_name):
parser = super(PurgeContainer, self).get_parser(prog_name)
parser.add_argument(
'container',
metavar='<container>',
help='Container to purge',
)
return parser

def take_action(self, parsed_args):
self.log.debug('take_action(%s)', parsed_args)

account = self.app.client_manager.account
self.app.client_manager.storage.container.container_purge(
account, parsed_args.container
)


class RefreshContainer(command.Command):
""" Refresh counters of an account (triggers asynchronous treatments) """

Expand Down
6 changes: 0 additions & 6 deletions proxy/meta2v2_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,6 @@ m2v2_remote_pack_PROP_GET(struct oio_url_s *url, guint32 flags)
return _m2v2_pack_request_with_flags(NAME_MSGNAME_M2V2_PROP_GET, url, NULL, flags);
}

GByteArray*
m2v2_remote_pack_EXITELECTION(struct oio_url_s *url)
{
return _m2v2_pack_request(NAME_MSGNAME_M2V2_EXITELECTION, url, NULL);
}

GByteArray*
m2v2_remote_pack_TOUCHC(struct oio_url_s *url)
{
Expand Down
1 change: 0 additions & 1 deletion proxy/meta2v2_remote.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ GByteArray* m2v2_remote_pack_PROP_SET(
/* accepts M2V2_FLAG_MASTER */
GByteArray* m2v2_remote_pack_PROP_GET(struct oio_url_s *url, guint32 flags);

GByteArray* m2v2_remote_pack_EXITELECTION(struct oio_url_s *url);
GByteArray* m2v2_remote_pack_TOUCHB(struct oio_url_s *url, guint32 flags);
GByteArray* m2v2_remote_pack_TOUCHC(struct oio_url_s *url);

Expand Down
9 changes: 5 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ openio.account =
openio.container =
container_create = oio.cli.container.container:CreateContainer
container_delete = oio.cli.container.container:DeleteContainer
container_touch = oio.cli.container.container:TouchContainer
container_list = oio.cli.container.container:ListContainer
container_locate = oio.cli.container.container:LocateContainer
container_purge = oio.cli.container.container:PurgeContainer
container_refresh = oio.cli.container.container:RefreshContainer
container_save = oio.cli.container.container:SaveContainer
container_set = oio.cli.container.container:SetContainer
container_locate = oio.cli.container.container:LocateContainer
container_show = oio.cli.container.container:ShowContainer
container_unset = oio.cli.container.container:UnsetContainer
container_refresh = oio.cli.container.container:RefreshContainer
container_snapshot = oio.cli.container.container:SnapshotContainer
container_touch = oio.cli.container.container:TouchContainer
container_unset = oio.cli.container.container:UnsetContainer
openio.lifecycle =
lifecycle_apply = oio.cli.lifecycle.lifecycle:LifecycleApply
lifecycle_get = oio.cli.lifecycle.lifecycle:LifecycleGet
Expand Down