@InterfaceAudience.Private public class InputStreamBlockDistribution extends Object
This class only gets instantiated for the first FSDataInputStream of each StoreFile (i.e.
the one backing HStoreFile.initialReader). It's then used to dynamically update the value
returned by HStoreFile.getHDFSBlockDistribution().
Once the backing FSDataInputStream is closed, we should not expect the distribution result to
change anymore. This is ok becuase the initialReader's InputStream is only closed when the
StoreFile itself is closed, at which point nothing will be querying getHDFSBlockDistribution
anymore. If/When the StoreFile is reopened, a new InputStreamBlockDistribution will be
created for the new initialReader.
| Constructor and Description |
|---|
InputStreamBlockDistribution(org.apache.hadoop.fs.FSDataInputStream stream,
StoreFileInfo fileInfo)
This should only be called for the first FSDataInputStream of a StoreFile, in
HStoreFile.open(). |
| Modifier and Type | Method and Description |
|---|---|
HDFSBlocksDistribution |
getHDFSBlockDistribution()
Get the HDFSBlocksDistribution derived from the StoreFile input stream, re-computing if cache
is expired.
|
static boolean |
isEnabled(org.apache.hadoop.conf.Configuration conf)
True if we should derive StoreFile HDFSBlockDistribution from the underlying input stream
|
public InputStreamBlockDistribution(org.apache.hadoop.fs.FSDataInputStream stream,
StoreFileInfo fileInfo)
HStoreFile.open().stream - the input stream to derive locality fromfileInfo - the StoreFileInfo for the related store fileInputStreamBlockDistributionpublic static boolean isEnabled(org.apache.hadoop.conf.Configuration conf)
public HDFSBlocksDistribution getHDFSBlockDistribution()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.