org.apache.accumulo.core.file.map
Class MyMapFile

java.lang.Object
  extended by org.apache.accumulo.core.file.map.MyMapFile

Deprecated. since 1.4, replaced by RFile

public class MyMapFile
extends Object

A file-based map from keys to values.

A map is a directory containing two files, the data file, containing all keys and values in the map, and a smaller index file, containing a fraction of the keys. The fraction is determined by MyMapFile.Writer.getIndexInterval().

The index file is read entirely into memory. Thus key implementations should try to keep themselves small.

Map files are created by adding entries in-order. To maintain a large database, perform updates by copying the previous version of a database and merging in a sorted change list, to create a new version of the database in a new file. Sorting large change lists can be done with MySequenceFile.Sorter.


Nested Class Summary
static class MyMapFile.Reader
          Deprecated. Provide access to an existing map.
static class MyMapFile.Writer
          Deprecated. Writes a new map.
 
Field Summary
static String DATA_FILE_NAME
          Deprecated. The name of the data file.
static String EXTENSION
          Deprecated. since 1.4, replaced by Constants.MAPFILE_EXTENSION
static String INDEX_FILE_NAME
          Deprecated. The name of the index file.
static Stat mapFileSeekScanCompareTime
          Deprecated.  
static Stat mapFileSeekScans
          Deprecated.  
static Stat mapFileSeekScanTime
          Deprecated.  
static Stat mapFileSeekTimeStat
          Deprecated.  
 
Constructor Summary
protected MyMapFile()
          Deprecated.  
 
Method Summary
static void delete(org.apache.hadoop.fs.FileSystem fs, String name)
          Deprecated. Deletes the named map file.
static long fix(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path dir, Class<? extends org.apache.hadoop.io.WritableComparable> keyClass, Class<? extends org.apache.hadoop.io.Writable> valueClass, boolean dryrun, org.apache.hadoop.conf.Configuration conf)
          Deprecated. This method attempts to fix a corrupt MapFile by re-creating its index.
static int getIndexInterval()
          Deprecated.  
static void main(String[] args)
          Deprecated.  
static void rename(org.apache.hadoop.fs.FileSystem fs, String oldName, String newName)
          Deprecated. Renames an existing map directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTENSION

public static final String EXTENSION
Deprecated. since 1.4, replaced by Constants.MAPFILE_EXTENSION
See Also:
Constant Field Values

INDEX_FILE_NAME

public static final String INDEX_FILE_NAME
Deprecated. 
The name of the index file.

See Also:
Constant Field Values

DATA_FILE_NAME

public static final String DATA_FILE_NAME
Deprecated. 
The name of the data file.

See Also:
Constant Field Values

mapFileSeekTimeStat

public static final Stat mapFileSeekTimeStat
Deprecated. 

mapFileSeekScans

public static final Stat mapFileSeekScans
Deprecated. 

mapFileSeekScanTime

public static final Stat mapFileSeekScanTime
Deprecated. 

mapFileSeekScanCompareTime

public static final Stat mapFileSeekScanCompareTime
Deprecated. 
Constructor Detail

MyMapFile

protected MyMapFile()
Deprecated. 
Method Detail

rename

public static void rename(org.apache.hadoop.fs.FileSystem fs,
                          String oldName,
                          String newName)
                   throws IOException
Deprecated. 
Renames an existing map directory.

Throws:
IOException

delete

public static void delete(org.apache.hadoop.fs.FileSystem fs,
                          String name)
                   throws IOException
Deprecated. 
Deletes the named map file.

Throws:
IOException

getIndexInterval

public static int getIndexInterval()
Deprecated. 

fix

public static long fix(org.apache.hadoop.fs.FileSystem fs,
                       org.apache.hadoop.fs.Path dir,
                       Class<? extends org.apache.hadoop.io.WritableComparable> keyClass,
                       Class<? extends org.apache.hadoop.io.Writable> valueClass,
                       boolean dryrun,
                       org.apache.hadoop.conf.Configuration conf)
                throws Exception
Deprecated. 
This method attempts to fix a corrupt MapFile by re-creating its index. Code copied from hadoop (0.18.0) because it was broken there. This is a fixed version. Do not want to loose changes if MyMapFile is updated.

Parameters:
fs - filesystem
dir - directory containing the MapFile data and index
keyClass - key class (has to be a subclass of Writable)
valueClass - value class (has to be a subclass of Writable)
dryrun - do not perform any changes, just report what needs to be done
Returns:
number of valid entries in this MapFile, or -1 if no fixing was needed
Throws:
Exception

main

public static void main(String[] args)
                 throws Exception
Deprecated. 
Throws:
Exception


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.