private byte[] endOf(HStoreFile sf) { byte[] result = fileEnds.get(sf); // result and INVALID_KEY_IN_MAP are compared _only_ by reference on purpose here as the latter // serves only as a marker and is not to be confused with other empty byte arrays. // See Javadoc of INVALID_KEY_IN_MAP for more information return (result == null) ? sf.getMetadataValue(STRIPE_END_KEY) : result == INVALID_KEY_IN_MAP ? INVALID_KEY : result; }
private byte[] startOf(HStoreFile sf) { byte[] result = fileStarts.get(sf); // result and INVALID_KEY_IN_MAP are compared _only_ by reference on purpose here as the latter // serves only as a marker and is not to be confused with other empty byte arrays. // See Javadoc of INVALID_KEY_IN_MAP for more information return (result == null) ? sf.getMetadataValue(STRIPE_START_KEY) : result == INVALID_KEY_IN_MAP ? INVALID_KEY : result; }
private static void setFileStripe(HStoreFile sf, byte[] startKey, byte[] endKey) { when(sf.getMetadataValue(StripeStoreFileManager.STRIPE_START_KEY)).thenReturn(startKey); when(sf.getMetadataValue(StripeStoreFileManager.STRIPE_END_KEY)).thenReturn(endKey); }
private static HStoreFile createFile() throws Exception { HStoreFile sf = mock(HStoreFile.class); when(sf.getMetadataValue(any())) .thenReturn(StripeStoreFileManager.INVALID_KEY); when(sf.getReader()).thenReturn(mock(StoreFileReader.class)); when(sf.getPath()).thenReturn(new Path("moo")); when(sf.getBulkLoadTimestamp()).thenReturn(OptionalLong.empty()); return sf; }
private static void setFileStripe(HStoreFile sf, byte[] startKey, byte[] endKey) { when(sf.getMetadataValue(StripeStoreFileManager.STRIPE_START_KEY)).thenReturn(startKey); when(sf.getMetadataValue(StripeStoreFileManager.STRIPE_END_KEY)).thenReturn(endKey); }
private static HStoreFile createFile() throws Exception { HStoreFile sf = mock(HStoreFile.class); when(sf.getMetadataValue(any())) .thenReturn(StripeStoreFileManager.INVALID_KEY); when(sf.getReader()).thenReturn(mock(StoreFileReader.class)); when(sf.getPath()).thenReturn(new Path("moo")); when(sf.getBulkLoadTimestamp()).thenReturn(OptionalLong.empty()); return sf; }