@Test public void testconvertUUIDToLong() { logger.debug("Convert UUID to Long"); UUID type4Uuid = UUID.randomUUID(); UUID type4Uuid2 = UUID.randomUUID(); String uuidInStr = "123e4567-e89b-12d3-a456-426655440000"; UUID type1Uuid = UUID.fromString(uuidInStr); Long outType4Val1 = PrimaryIndexBucketLocatorImpl.convertUuidToLong(type4Uuid); Long outType4Val2 = PrimaryIndexBucketLocatorImpl.convertUuidToLong(type4Uuid2); Long outType1Val3 = PrimaryIndexBucketLocatorImpl.convertUuidToLong(type1Uuid); assertTrue(outType4Val1 + "is different from outType4Val2", !outType4Val1.equals(outType4Val2)); assertTrue(outType1Val3 + "is different from outType4Val1", !outType1Val3.equals(outType4Val1)); }
protected static Long convertUuidToLong(UUID uuid) { if (uuid == null) { return null; } Long convertedUuid; if (uuid.version() == 1) { convertedUuid = uuid.timestamp(); } else { convertedUuid = uuid.getMostSignificantBits(); } return convertedUuid; }
PrimaryIndexBucketLocatorImpl implements BucketLocator { protected static Long convertUuidToLong(UUID uuid) { if (uuid == null) { return null; } Long convertedUuid; if (uuid.version() == 1) { convertedUuid = uuid.timestamp(); } else { convertedUuid = uuid.getMostSignificantBits(); } return convertedUuid; } }
PrimaryIndexBucketLocatorImpl implements BucketLocator { protected static Long convertUuidToLong(UUID uuid) { if (uuid == null) { return null; } Long convertedUuid; if (uuid.version() == 1) { convertedUuid = uuid.timestamp(); } else { convertedUuid = uuid.getMostSignificantBits(); } return convertedUuid; } private  PrimaryIndexBucketLocatorImpl(); @Deprecated  PrimaryIndexBucketLocatorImpl(List<Long> textBuckets, List<Long> dateTimeBuckets,
            List<Long> doubleBuckets, List<Long> integerBuckets, List<Long> booleanBuckets,
            List<Long> uuidBuckets, List<Long> binaryBuckets, List<Long> longBuckets, List<Long> timepointBuckets); }
PrimaryIndexBucketLocatorImpl implements BucketLocator { protected static Long convertUuidToLong(UUID uuid) { if (uuid == null) { return null; } Long convertedUuid; if (uuid.version() == 1) { convertedUuid = uuid.timestamp(); } else { convertedUuid = uuid.getMostSignificantBits(); } return convertedUuid; } private  PrimaryIndexBucketLocatorImpl(); @Deprecated  PrimaryIndexBucketLocatorImpl(List<Long> textBuckets, List<Long> dateTimeBuckets,
            List<Long> doubleBuckets, List<Long> integerBuckets, List<Long> booleanBuckets,
            List<Long> uuidBuckets, List<Long> binaryBuckets, List<Long> longBuckets, List<Long> timepointBuckets); static PrimaryIndexBucketLocatorImpl getInstance(); @Override Long getBucket(Object bucketingObject, FieldDataType dataType); static Long convertObjectToBucketingToken(Object toBeConverted, FieldDataType dataType); static List<Long>[] getBUCKETS(); }
PrimaryIndexBucketLocatorImpl implements BucketLocator { protected static Long convertUuidToLong(UUID uuid) { if (uuid == null) { return null; } Long convertedUuid; if (uuid.version() == 1) { convertedUuid = uuid.timestamp(); } else { convertedUuid = uuid.getMostSignificantBits(); } return convertedUuid; } private  PrimaryIndexBucketLocatorImpl(); @Deprecated  PrimaryIndexBucketLocatorImpl(List<Long> textBuckets, List<Long> dateTimeBuckets,
            List<Long> doubleBuckets, List<Long> integerBuckets, List<Long> booleanBuckets,
            List<Long> uuidBuckets, List<Long> binaryBuckets, List<Long> longBuckets, List<Long> timepointBuckets); static PrimaryIndexBucketLocatorImpl getInstance(); @Override Long getBucket(Object bucketingObject, FieldDataType dataType); static Long convertObjectToBucketingToken(Object toBeConverted, FieldDataType dataType); static List<Long>[] getBUCKETS();  }