Package org.apache.accumulo.server.util
Class FileUtil
- java.lang.Object
-
- org.apache.accumulo.server.util.FileUtil
-
public class FileUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileUtil.FileInfo
-
Constructor Summary
Constructors Constructor Description FileUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidcleanupIndexOp(org.apache.hadoop.fs.Path tmpDir, VolumeManager fs, ArrayList<FileSKVIterator> readers)static doubleestimatePercentageLTE(ServerContext context, TableConfiguration tableConf, String tabletDir, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<? extends TabletFile> dataFiles, org.apache.hadoop.io.Text splitRow)static <T extends TabletFile>
org.apache.hadoop.io.WritableComparable<Key>findLastKey(ServerContext context, TableConfiguration tableConf, Collection<T> dataFiles)static SortedMap<Double,Key>findMidPoint(ServerContext context, TableConfiguration tableConf, String tabletDirectory, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<? extends TabletFile> dataFiles, double minSplit, boolean useIndex)static Collection<? extends TabletFile>reduceFiles(ServerContext context, TableConfiguration tableConf, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<? extends TabletFile> dataFiles, int maxFiles, org.apache.hadoop.fs.Path tmpDir, int pass)static Collection<String>toPathStrings(Collection<ReferencedTabletFile> files)Convert TabletFiles to Strings in case we need to reduce number of files.static <T extends TabletFile>
Map<T,FileUtil.FileInfo>tryToGetFirstAndLastRows(ServerContext context, TableConfiguration tableConf, Set<T> dataFiles)
-
-
-
Method Detail
-
reduceFiles
public static Collection<? extends TabletFile> reduceFiles(ServerContext context, TableConfiguration tableConf, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<? extends TabletFile> dataFiles, int maxFiles, org.apache.hadoop.fs.Path tmpDir, int pass) throws IOException
- Throws:
IOException
-
estimatePercentageLTE
public static double estimatePercentageLTE(ServerContext context, TableConfiguration tableConf, String tabletDir, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<? extends TabletFile> dataFiles, org.apache.hadoop.io.Text splitRow) throws IOException
- Throws:
IOException
-
findMidPoint
public static SortedMap<Double,Key> findMidPoint(ServerContext context, TableConfiguration tableConf, String tabletDirectory, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<? extends TabletFile> dataFiles, double minSplit, boolean useIndex) throws IOException
- Parameters:
dataFiles- - list of data files to find the mid point key ISSUES : This method used the index files to find the mid point. If the data files have different index intervals this method will not return an accurate mid point. Also, it would be tricky to use this method in conjunction with an in memory map because the indexing interval is unknown.- Throws:
IOException
-
cleanupIndexOp
protected static void cleanupIndexOp(org.apache.hadoop.fs.Path tmpDir, VolumeManager fs, ArrayList<FileSKVIterator> readers) throws IOException- Throws:
IOException
-
tryToGetFirstAndLastRows
public static <T extends TabletFile> Map<T,FileUtil.FileInfo> tryToGetFirstAndLastRows(ServerContext context, TableConfiguration tableConf, Set<T> dataFiles)
-
findLastKey
public static <T extends TabletFile> org.apache.hadoop.io.WritableComparable<Key> findLastKey(ServerContext context, TableConfiguration tableConf, Collection<T> dataFiles) throws IOException
- Throws:
IOException
-
toPathStrings
public static Collection<String> toPathStrings(Collection<ReferencedTabletFile> files)
Convert TabletFiles to Strings in case we need to reduce number of files. The temporary files used will have irregular paths that don't conform to TabletFile verification.
-
-