private static BucketId convertGidToBucketId(String id) throws BucketStatsException {
        if (!id.matches("0x\\p{XDigit}{24}")) {
            throw new BucketStatsException("Invalid gid: " + id);
        }
        String hexWithoutPrefix = id.substring(2);
        return new GlobalId(convertHexStringToByteArray(hexWithoutPrefix)).toBucketId();
    }
This class fetches bucket information from Vespa

@author bjorncs
vespaclient-java/src/main/java/com/yahoo/vespastat/BucketStatsRetriever.java