summaryrefslogtreecommitdiffstats
path: root/persistence/src/main/java/com/yahoo/persistence/spi/Bucket.java
blob: 0c9a8d164763ab192697ee903d7b50e35f1da97f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.persistence.spi;

import com.yahoo.document.BucketId;

/**
 * @author thomasg
 */
public class Bucket {
    BucketId bucketId;
    short partitionId;

    /**
     * @param partition The partition (i.e. disk) where the bucket is located
     * @param bucketId The bucket id of the bucket
     */
    public Bucket(short partition, BucketId bucketId) {
        this.partitionId = partition;
        this.bucketId = bucketId;
    }

    public BucketId getBucketId() { return bucketId; }

    public short getPartitionId() { return partitionId; }

    @Override
    public String toString() {
        return partitionId + "/" + bucketId;
    }
}