org.apache.accumulo.server.tabletserver
Class Tablet

java.lang.Object
  extended by org.apache.accumulo.server.tabletserver.Tablet

public class Tablet
extends Object

this class just provides an interface to read from a MapFile mostly takes care of reporting start and end keys need this because a single row extent can have multiple columns this manages all the columns (each handled by a store) for a single row-extent


Nested Class Summary
 class Tablet.CommitSession
           
static class Tablet.KVEntry
           
static interface Tablet.KVReceiver
           
static class Tablet.TabletClosedException
           
 
Field Summary
 Object bulkFileImportLock
           
 TabletStatsKeeper timer
           
 
Constructor Summary
Tablet(TabletServer tabletServer, org.apache.hadoop.io.Text location, KeyExtent extent, TabletServerResourceManager.TabletResourceManager trm, SortedMap<Key,Value> tabletsKeyValues)
           
Tablet(TabletServer tabletServer, org.apache.hadoop.io.Text location, KeyExtent extent, TabletServerResourceManager.TabletResourceManager trm, SortedMap<String,MetadataTable.DataFileValue> datafiles, String time, long initFlushID, long initCompactID)
           
 
Method Summary
 void abortCommit(Tablet.CommitSession commitSession, List<Mutation> value)
           
 void chopFiles()
           
 void close(boolean saveState)
          Closes the mapfiles associated with a Tablet.
 void commit(Tablet.CommitSession commitSession, List<Mutation> mutations)
           
 void compactAll(long compactionId)
           
 long estimateTabletSize()
          Returns an int representing the total block size of the mapfiles served by this tablet.
 SortedMap<String,MetadataTable.DataFileValue> getDatafiles()
           
 KeyExtent getExtent()
          Returns a KeyExtent object representing this tablet's key range.
 org.apache.hadoop.fs.Path getLocation()
          Returns a Path object representing the tablet's location on the DFS.
 int getLogCount()
           
 int getLogId()
           
 long getNumEntries()
           
 long getNumEntriesInMemory()
           
 long getSplitCreationTime()
           
 void importMapFiles(long tid, Map<String,MapFileInfo> fileMap, boolean setTime)
           
 double ingestByteRate()
           
 double ingestRate()
           
 boolean isCloseComplete()
           
 boolean isClosed()
           
 boolean isClosing()
           
 boolean isMetadataTablet()
           
 org.apache.accumulo.server.tabletserver.Tablet.LookupResult lookup(List<Range> ranges, HashSet<Column> columns, Authorizations authorizations, ArrayList<Tablet.KVEntry> results, long maxResultSize, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, AtomicBoolean interruptFlag)
           
 boolean majorCompactionQueued()
           
 boolean majorCompactionRunning()
           
 boolean minorCompactionQueued()
           
 boolean minorCompactionRunning()
           
 boolean needsMajorCompaction(org.apache.accumulo.server.tabletserver.Tablet.MajorCompactionReason reason)
          Returns true if a major compaction should be performed on the tablet.
 boolean needsSplit()
          Returns true if this tablet needs to be split
 Tablet.CommitSession prepareMutationsForCommit(org.apache.accumulo.server.tabletserver.TabletServer.TservConstraintEnv cenv, List<Mutation> mutations)
           
 double queryByteRate()
           
 double queryRate()
           
 TreeMap<KeyExtent,org.apache.accumulo.server.tabletserver.Tablet.SplitInfo> split(byte[] sp)
           
 long totalIngest()
           
 long totalQueries()
           
 void updateRates(long now)
           
 void waitForMinC()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timer

public TabletStatsKeeper timer

bulkFileImportLock

public Object bulkFileImportLock
Constructor Detail

Tablet

public Tablet(TabletServer tabletServer,
              org.apache.hadoop.io.Text location,
              KeyExtent extent,
              TabletServerResourceManager.TabletResourceManager trm,
              SortedMap<Key,Value> tabletsKeyValues)
       throws IOException
Throws:
IOException

Tablet

public Tablet(TabletServer tabletServer,
              org.apache.hadoop.io.Text location,
              KeyExtent extent,
              TabletServerResourceManager.TabletResourceManager trm,
              SortedMap<String,MetadataTable.DataFileValue> datafiles,
              String time,
              long initFlushID,
              long initCompactID)
       throws IOException
Throws:
IOException
Method Detail

getLogId

public int getLogId()

isMetadataTablet

public boolean isMetadataTablet()

lookup

public org.apache.accumulo.server.tabletserver.Tablet.LookupResult lookup(List<Range> ranges,
                                                                          HashSet<Column> columns,
                                                                          Authorizations authorizations,
                                                                          ArrayList<Tablet.KVEntry> results,
                                                                          long maxResultSize,
                                                                          List<IterInfo> ssiList,
                                                                          Map<String,Map<String,String>> ssio,
                                                                          AtomicBoolean interruptFlag)
                                                                   throws IOException
Throws:
IOException

waitForMinC

public void waitForMinC()

prepareMutationsForCommit

public Tablet.CommitSession prepareMutationsForCommit(org.apache.accumulo.server.tabletserver.TabletServer.TservConstraintEnv cenv,
                                                      List<Mutation> mutations)
                                               throws org.apache.accumulo.server.tabletserver.Tablet.TConstraintViolationException
Throws:
org.apache.accumulo.server.tabletserver.Tablet.TConstraintViolationException

abortCommit

public void abortCommit(Tablet.CommitSession commitSession,
                        List<Mutation> value)

commit

public void commit(Tablet.CommitSession commitSession,
                   List<Mutation> mutations)

close

public void close(boolean saveState)
           throws IOException
Closes the mapfiles associated with a Tablet. If saveState is true, a minor compaction is performed.

Throws:
IOException

getLocation

public org.apache.hadoop.fs.Path getLocation()
Returns a Path object representing the tablet's location on the DFS.

Returns:
location

needsMajorCompaction

public boolean needsMajorCompaction(org.apache.accumulo.server.tabletserver.Tablet.MajorCompactionReason reason)
Returns true if a major compaction should be performed on the tablet.


estimateTabletSize

public long estimateTabletSize()
Returns an int representing the total block size of the mapfiles served by this tablet.

Returns:
size

needsSplit

public boolean needsSplit()
Returns true if this tablet needs to be split


getExtent

public KeyExtent getExtent()
Returns a KeyExtent object representing this tablet's key range.

Returns:
extent

getNumEntries

public long getNumEntries()

getNumEntriesInMemory

public long getNumEntriesInMemory()

isClosing

public boolean isClosing()

isClosed

public boolean isClosed()

isCloseComplete

public boolean isCloseComplete()

majorCompactionRunning

public boolean majorCompactionRunning()

minorCompactionQueued

public boolean minorCompactionQueued()

minorCompactionRunning

public boolean minorCompactionRunning()

majorCompactionQueued

public boolean majorCompactionQueued()

split

public TreeMap<KeyExtent,org.apache.accumulo.server.tabletserver.Tablet.SplitInfo> split(byte[] sp)
                                                                                  throws IOException
Throws:
IOException

getDatafiles

public SortedMap<String,MetadataTable.DataFileValue> getDatafiles()

queryRate

public double queryRate()

queryByteRate

public double queryByteRate()

ingestRate

public double ingestRate()

ingestByteRate

public double ingestByteRate()

totalQueries

public long totalQueries()

totalIngest

public long totalIngest()

updateRates

public void updateRates(long now)

getSplitCreationTime

public long getSplitCreationTime()

importMapFiles

public void importMapFiles(long tid,
                           Map<String,MapFileInfo> fileMap,
                           boolean setTime)
                    throws IOException
Throws:
IOException

getLogCount

public int getLogCount()

chopFiles

public void chopFiles()

compactAll

public void compactAll(long compactionId)


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