aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storageapi/app/getbucketid.cpp
blob: f69be8491c3ef3772b603147b7372d201ead364f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright Vespa.ai. 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());
}