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(ServerContext context, String tabletDir, 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(ServerContext context, org.apache.hadoop.fs.Path mapFile, long fileSize, List<KeyExtent> extents)
static org.apache.hadoop.io.WritableComparable<Key>
findLastKey(ServerContext context, Collection<FileRef> mapFiles)
static SortedMap<Double,Key>
findMidPoint(ServerContext context, String tabletDir, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<String> mapFiles, double minSplit)
static SortedMap<Double,Key>
findMidPoint(ServerContext context, String tabletDirectory, org.apache.hadoop.io.Text prevEndRow, org.apache.hadoop.io.Text endRow, Collection<String> mapFiles, double minSplit, boolean useIndex)
static Collection<String>
reduceFiles(ServerContext context, org.apache.hadoop.conf.Configuration conf, 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(ServerContext context, Set<FileRef> mapfiles)
-
-
-
Method Detail
-
reduceFiles
public static Collection<String> reduceFiles(ServerContext context, org.apache.hadoop.conf.Configuration conf, 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(ServerContext context, String tabletDir, 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(ServerContext context, String tabletDir, 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(ServerContext context, String tabletDirectory, 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(ServerContext context, Set<FileRef> mapfiles)
-
findLastKey
public static org.apache.hadoop.io.WritableComparable<Key> findLastKey(ServerContext context, Collection<FileRef> mapFiles) throws IOException
- Throws:
IOException
-
estimateSizes
public static Map<KeyExtent,Long> estimateSizes(ServerContext context, org.apache.hadoop.fs.Path mapFile, long fileSize, List<KeyExtent> extents) throws IOException
- Throws:
IOException
-
toPathStrings
public static Collection<String> toPathStrings(Collection<FileRef> refs)
-
-