diff options
Diffstat (limited to 'storage/src/vespa/storageapi/app/getbucketid.cpp')
-rw-r--r-- | storage/src/vespa/storageapi/app/getbucketid.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/storage/src/vespa/storageapi/app/getbucketid.cpp b/storage/src/vespa/storageapi/app/getbucketid.cpp new file mode 100644 index 00000000000..21f7912d1a1 --- /dev/null +++ b/storage/src/vespa/storageapi/app/getbucketid.cpp @@ -0,0 +1,18 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include <vespa/document/bucket/bucketidfactory.h> +#include <vespa/document/base/documentid.h> +#include <iostream> + +int main(int argc, char** argv) +{ + if (argc != 2) { + std::cerr << "Usage: getbucketid <documentid>\n"; + return 1; + } + document::BucketIdFactory factory; + document::BucketId id = factory.getBucketId(document::DocumentId(argv[1])); + + printf("%s has bucketid %s\n", argv[1], id.toString().c_str()); +} + + |