org.apache.accumulo.server.logger
Class LogService

java.lang.Object
  extended by org.apache.accumulo.server.logger.LogService
All Implemented Interfaces:
MutationLogger.Iface, org.apache.zookeeper.Watcher

public class LogService
extends Object
implements MutationLogger.Iface, org.apache.zookeeper.Watcher

A Mutation logging service. This class will register the logging service in ZooKeeper, log updates from tservers, and provided logs to HDFS for recovery. Wraps the LogWriter, but provides configuration, authentication and ZooKeeper registration. This makes the LogWriter easier to test. The service will stop if it loses its ephemeral registration in ZooKeeper.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher
org.apache.zookeeper.Watcher.Event
 
Constructor Summary
LogService(String[] args)
           
 
Method Summary
 void beginShutdown(TInfo tinfo, AuthInfo credentials)
           
 void close(TInfo info, long id)
           
 LogFile create(TInfo info, AuthInfo credentials, String tserverSession)
           
 void defineTablet(TInfo info, long id, long seq, int tid, TKeyExtent tablet)
           
 List<String> getClosedLogs(TInfo info, AuthInfo credentials)
           
 void halt(TInfo tinfo, AuthInfo credentials)
           
 void log(TInfo info, long id, long seq, int tid, TMutation mutation)
           
 void logManyTablets(TInfo info, long id, List<TabletMutations> mutations)
           
static void main(String[] args)
           
 void minorCompactionFinished(TInfo info, long id, long seq, int tid, String fqfn)
           
 void minorCompactionStarted(TInfo info, long id, long seq, int tid, String fqfn)
           
 void process(org.apache.zookeeper.WatchedEvent event)
           
 void remove(TInfo info, AuthInfo credentials, List<String> files)
           
 void run()
           
 LogCopyInfo startCopy(TInfo info, AuthInfo credentials, String localLog, String fullyQualifiedFileName, boolean sort)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogService

public LogService(String[] args)
           throws UnknownHostException,
                  org.apache.zookeeper.KeeperException,
                  InterruptedException,
                  IOException
Throws:
UnknownHostException
org.apache.zookeeper.KeeperException
InterruptedException
IOException
Method Detail

main

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

run

public void run()

close

public void close(TInfo info,
                  long id)
           throws NoSuchLogIDException,
                  LoggerClosedException,
                  org.apache.thrift.TException
Specified by:
close in interface MutationLogger.Iface
Throws:
NoSuchLogIDException
LoggerClosedException
org.apache.thrift.TException

startCopy

public LogCopyInfo startCopy(TInfo info,
                             AuthInfo credentials,
                             String localLog,
                             String fullyQualifiedFileName,
                             boolean sort)
                      throws ThriftSecurityException,
                             org.apache.thrift.TException
Specified by:
startCopy in interface MutationLogger.Iface
Throws:
ThriftSecurityException
org.apache.thrift.TException

create

public LogFile create(TInfo info,
                      AuthInfo credentials,
                      String tserverSession)
               throws ThriftSecurityException,
                      LoggerClosedException,
                      org.apache.thrift.TException
Specified by:
create in interface MutationLogger.Iface
Throws:
ThriftSecurityException
LoggerClosedException
org.apache.thrift.TException

log

public void log(TInfo info,
                long id,
                long seq,
                int tid,
                TMutation mutation)
         throws NoSuchLogIDException,
                LoggerClosedException,
                org.apache.thrift.TException
Specified by:
log in interface MutationLogger.Iface
Throws:
NoSuchLogIDException
LoggerClosedException
org.apache.thrift.TException

logManyTablets

public void logManyTablets(TInfo info,
                           long id,
                           List<TabletMutations> mutations)
                    throws NoSuchLogIDException,
                           LoggerClosedException,
                           org.apache.thrift.TException
Specified by:
logManyTablets in interface MutationLogger.Iface
Throws:
NoSuchLogIDException
LoggerClosedException
org.apache.thrift.TException

minorCompactionFinished

public void minorCompactionFinished(TInfo info,
                                    long id,
                                    long seq,
                                    int tid,
                                    String fqfn)
                             throws NoSuchLogIDException,
                                    LoggerClosedException,
                                    org.apache.thrift.TException
Specified by:
minorCompactionFinished in interface MutationLogger.Iface
Throws:
NoSuchLogIDException
LoggerClosedException
org.apache.thrift.TException

minorCompactionStarted

public void minorCompactionStarted(TInfo info,
                                   long id,
                                   long seq,
                                   int tid,
                                   String fqfn)
                            throws NoSuchLogIDException,
                                   LoggerClosedException,
                                   org.apache.thrift.TException
Specified by:
minorCompactionStarted in interface MutationLogger.Iface
Throws:
NoSuchLogIDException
LoggerClosedException
org.apache.thrift.TException

defineTablet

public void defineTablet(TInfo info,
                         long id,
                         long seq,
                         int tid,
                         TKeyExtent tablet)
                  throws NoSuchLogIDException,
                         LoggerClosedException,
                         org.apache.thrift.TException
Specified by:
defineTablet in interface MutationLogger.Iface
Throws:
NoSuchLogIDException
LoggerClosedException
org.apache.thrift.TException

process

public void process(org.apache.zookeeper.WatchedEvent event)
Specified by:
process in interface org.apache.zookeeper.Watcher

getClosedLogs

public List<String> getClosedLogs(TInfo info,
                                  AuthInfo credentials)
                           throws ThriftSecurityException,
                                  org.apache.thrift.TException
Specified by:
getClosedLogs in interface MutationLogger.Iface
Throws:
ThriftSecurityException
org.apache.thrift.TException

remove

public void remove(TInfo info,
                   AuthInfo credentials,
                   List<String> files)
            throws org.apache.thrift.TException
Specified by:
remove in interface MutationLogger.Iface
Throws:
org.apache.thrift.TException

beginShutdown

public void beginShutdown(TInfo tinfo,
                          AuthInfo credentials)
                   throws org.apache.thrift.TException
Specified by:
beginShutdown in interface MutationLogger.Iface
Throws:
org.apache.thrift.TException

halt

public void halt(TInfo tinfo,
                 AuthInfo credentials)
          throws org.apache.thrift.TException
Specified by:
halt in interface MutationLogger.Iface
Throws:
org.apache.thrift.TException


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