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 class
FileUtil.FileInfo
-
Constructor Summary
Constructors Constructor Description FileUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static void
cleanupIndexOp(org.apache.hadoop.fs.Path tmpDir, VolumeManager fs, ArrayList<FileSKVIterator> readers)
static double
estimatePercentageLTE(VolumeManager fs, AccumuloConfiguration acuconf, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<String> mapFiles, org.apache.hadoop.io.Text splitRow)
static Map<KeyExtent,Long>
estimateSizes(AccumuloConfiguration acuConf, org.apache.hadoop.fs.Path mapFile, long fileSize, List<KeyExtent> extents, org.apache.hadoop.conf.Configuration conf, VolumeManager fs)
static org.apache.hadoop.io.WritableComparable<Key>
findLastKey(VolumeManager fs, AccumuloConfiguration acuConf, Collection<FileRef> mapFiles)
static SortedMap<Double,Key>
findMidPoint(VolumeManager fs, AccumuloConfiguration acuConf, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<String> mapFiles, double minSplit)
static SortedMap<Double,Key>
findMidPoint(VolumeManager fs, AccumuloConfiguration acuConf, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<String> mapFiles, double minSplit, boolean useIndex)
static Collection<String>
reduceFiles(AccumuloConfiguration acuConf, org.apache.hadoop.conf.Configuration conf, VolumeManager fs, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<String> mapFiles, int maxFiles, org.apache.hadoop.fs.Path tmpDir, int pass)
static Collection<String>
toPathStrings(Collection<FileRef> refs)
static Map<FileRef,FileUtil.FileInfo>
tryToGetFirstAndLastRows(VolumeManager fs, AccumuloConfiguration acuConf, Set<FileRef> mapfiles)
-
-
-
Method Detail
-
reduceFiles
public static Collection<String> reduceFiles(AccumuloConfiguration acuConf, org.apache.hadoop.conf.Configuration conf, VolumeManager fs, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<String> mapFiles, int maxFiles, org.apache.hadoop.fs.Path tmpDir, int pass) throws IOException
- Throws:
IOException
-
findMidPoint
public static SortedMap<Double,Key> findMidPoint(VolumeManager fs, AccumuloConfiguration acuConf, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<String> mapFiles, double minSplit) throws IOException
- Throws:
IOException
-
estimatePercentageLTE
public static double estimatePercentageLTE(VolumeManager fs, AccumuloConfiguration acuconf, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<String> mapFiles, org.apache.hadoop.io.Text splitRow) throws IOException
- Throws:
IOException
-
findMidPoint
public static SortedMap<Double,Key> findMidPoint(VolumeManager fs, AccumuloConfiguration acuConf, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<String> mapFiles, double minSplit, boolean useIndex) throws IOException
- Parameters:
mapFiles
- - list MapFiles to find the mid point key ISSUES : This method used the index files to find the mid point. If the map 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 Map<FileRef,FileUtil.FileInfo> tryToGetFirstAndLastRows(VolumeManager fs, AccumuloConfiguration acuConf, Set<FileRef> mapfiles)
-
findLastKey
public static org.apache.hadoop.io.WritableComparable<Key> findLastKey(VolumeManager fs, AccumuloConfiguration acuConf, Collection<FileRef> mapFiles) throws IOException
- Throws:
IOException
-
estimateSizes
public static Map<KeyExtent,Long> estimateSizes(AccumuloConfiguration acuConf, org.apache.hadoop.fs.Path mapFile, long fileSize, List<KeyExtent> extents, org.apache.hadoop.conf.Configuration conf, VolumeManager fs) throws IOException
- Throws:
IOException
-
toPathStrings
public static Collection<String> toPathStrings(Collection<FileRef> refs)
-
-