mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
remove ceph_dupstore
This is broken and useless. Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
a6357f2f62
commit
b889b6b5bf
@ -718,7 +718,6 @@ ln -sf %{_libdir}/librbd.so.1 /usr/lib64/qemu/librbd.so.1
|
||||
%files -n ceph-test
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/ceph_bench_log
|
||||
%{_bindir}/ceph_dupstore
|
||||
%{_bindir}/ceph_kvstorebench
|
||||
%{_bindir}/ceph_multi_stress_watch
|
||||
%{_bindir}/ceph_erasure_code
|
||||
|
1
debian/ceph-test.install
vendored
1
debian/ceph-test.install
vendored
@ -1,6 +1,5 @@
|
||||
usr/bin/ceph-coverage
|
||||
usr/bin/ceph_bench_log
|
||||
usr/bin/ceph_dupstore
|
||||
usr/bin/ceph_objectstore_tool
|
||||
usr/bin/ceph_kvstorebench
|
||||
usr/bin/ceph_multi_stress_watch
|
||||
|
1
src/.gitignore
vendored
1
src/.gitignore
vendored
@ -24,7 +24,6 @@ Makefile
|
||||
/ceph-syn
|
||||
/ceph.conf
|
||||
/ceph_bench_log
|
||||
/ceph_dupstore
|
||||
/ceph_objectstore_tool
|
||||
/ceph_mon_store_converter
|
||||
/ceph_multi_stress_watch
|
||||
|
@ -42,10 +42,6 @@ ceph_psim_SOURCES = tools/psim.cc
|
||||
ceph_psim_LDADD = $(CEPH_GLOBAL)
|
||||
bin_DEBUGPROGRAMS += ceph_psim
|
||||
|
||||
ceph_dupstore_SOURCES = tools/dupstore.cc
|
||||
ceph_dupstore_LDADD = $(LIBOS) $(CEPH_GLOBAL)
|
||||
bin_DEBUGPROGRAMS += ceph_dupstore
|
||||
|
||||
ceph_radosacl_SOURCES = tools/radosacl.cc
|
||||
ceph_radosacl_LDADD = $(LIBRADOS) $(CEPH_GLOBAL)
|
||||
bin_DEBUGPROGRAMS += ceph_radosacl
|
||||
|
@ -1,110 +0,0 @@
|
||||
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
|
||||
// vim: ts=8 sw=2 smarttab
|
||||
/*
|
||||
* Ceph - scalable distributed file system
|
||||
*
|
||||
* Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
|
||||
*
|
||||
* This is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License version 2.1, as published by the Free Software
|
||||
* Foundation. See file COPYING.
|
||||
*
|
||||
*/
|
||||
#include "common/ceph_argparse.h"
|
||||
#include "global/global_init.h"
|
||||
#include "include/unordered_map.h"
|
||||
#include "os/FileStore.h"
|
||||
|
||||
int dupstore(ObjectStore* src, ObjectStore* dst)
|
||||
{
|
||||
if (src->mount() < 0) return 1;
|
||||
if (dst->mkfs() < 0) return 1;
|
||||
if (dst->mount() < 0) return 1;
|
||||
|
||||
// objects
|
||||
ceph::unordered_map<ghobject_t, coll_t> did_object;
|
||||
|
||||
// collections
|
||||
vector<coll_t> collections;
|
||||
|
||||
int ret = src->list_collections(collections);
|
||||
if (ret < 0) {
|
||||
cerr << "Error " << ret << " while listing collections" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int num = collections.size();
|
||||
cout << num << " collections" << std::endl;
|
||||
int i = 1;
|
||||
for (vector<coll_t>::iterator p = collections.begin();
|
||||
p != collections.end();
|
||||
++p) {
|
||||
cout << "collection " << i++ << "/" << num << " " << hex << *p << dec << std::endl;
|
||||
{
|
||||
ObjectStore::Transaction t;
|
||||
t.create_collection(*p);
|
||||
map<string,bufferptr> attrs;
|
||||
src->collection_getattrs(*p, attrs);
|
||||
t.collection_setattrs(*p, attrs);
|
||||
dst->apply_transaction(t);
|
||||
}
|
||||
|
||||
vector<ghobject_t> o;
|
||||
src->collection_list(*p, o);
|
||||
int numo = o.size();
|
||||
int j = 1;
|
||||
for (vector<ghobject_t>::iterator q = o.begin(); q != o.end(); ++q) {
|
||||
ObjectStore::Transaction t;
|
||||
if (did_object.count(*q))
|
||||
t.collection_add(*p, did_object[*q], *q);
|
||||
else {
|
||||
bufferlist bl;
|
||||
src->read(*p, *q, 0, 0, bl);
|
||||
cout << "object " << j++ << "/" << numo << " " << *q << " = " << bl.length() << " bytes" << std::endl;
|
||||
t.write(*p, *q, 0, bl.length(), bl);
|
||||
map<string,bufferptr> attrs;
|
||||
src->getattrs(*p, *q, attrs);
|
||||
t.setattrs(*p, *q, attrs);
|
||||
did_object[*q] = *p;
|
||||
}
|
||||
dst->apply_transaction(t);
|
||||
}
|
||||
}
|
||||
|
||||
src->umount();
|
||||
dst->umount();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void usage()
|
||||
{
|
||||
cerr << "usage: ceph_dupstore filestore SRC filestore DST" << std::endl;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
vector<const char*> args;
|
||||
argv_to_vec(argc, argv, args);
|
||||
env_to_vec(args);
|
||||
|
||||
global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
|
||||
common_init_finish(g_ceph_context);
|
||||
|
||||
// args
|
||||
if (args.size() != 4)
|
||||
usage();
|
||||
|
||||
ObjectStore *src = 0, *dst = 0;
|
||||
|
||||
if (strcmp(args[0], "filestore") == 0)
|
||||
src = new FileStore(args[1], NULL);
|
||||
else usage();
|
||||
|
||||
if (strcmp(args[2], "filestore") == 0)
|
||||
dst = new FileStore(args[3], NULL);
|
||||
else usage();
|
||||
|
||||
return dupstore(src, dst);
|
||||
}
|
Loading…
Reference in New Issue
Block a user