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 java.lang.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(java.lang.String[] args)
           
 
Method Summary
 void close(TInfo info, long id)
           
 LogFile create(TInfo info, AuthInfo credentials, java.lang.String tserverSession)
           
 void defineTablet(TInfo info, long id, long seq, int tid, TKeyExtent tablet)
           
 java.util.List<java.lang.String> getClosedLogs(TInfo info, AuthInfo credentials)
           
 void log(TInfo info, long id, long seq, int tid, TMutation mutation)
           
 void logManyTablets(TInfo info, long id, java.util.List<TabletMutations> mutations)
           
static void main(java.lang.String[] args)
           
 void minorCompactionFinished(TInfo info, long id, long seq, int tid, java.lang.String fqfn)
           
 void minorCompactionStarted(TInfo info, long id, long seq, int tid, java.lang.String fqfn)
           
 void process(org.apache.zookeeper.WatchedEvent event)
           
 void remove(TInfo info, AuthInfo credentials, java.util.List<java.lang.String> files)
           
 void run()
           
 long startCopy(TInfo info, AuthInfo credentials, java.lang.String localLog, java.lang.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(java.lang.String[] args)
           throws java.net.UnknownHostException,
                  org.apache.zookeeper.KeeperException,
                  java.lang.InterruptedException,
                  java.io.IOException
Throws:
java.net.UnknownHostException
org.apache.zookeeper.KeeperException
java.lang.InterruptedException
java.io.IOException
Method Detail

main

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

run

public void run()

close

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

startCopy

public long startCopy(TInfo info,
                      AuthInfo credentials,
                      java.lang.String localLog,
                      java.lang.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,
                      java.lang.String tserverSession)
               throws ThriftSecurityException,
                      org.apache.thrift.TException
Specified by:
create in interface MutationLogger.Iface
Throws:
ThriftSecurityException
org.apache.thrift.TException

log

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

logManyTablets

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

minorCompactionFinished

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

minorCompactionStarted

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

defineTablet

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

process

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

getClosedLogs

public java.util.List<java.lang.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,
                   java.util.List<java.lang.String> files)
            throws org.apache.thrift.TException
Specified by:
remove in interface MutationLogger.Iface
Throws:
org.apache.thrift.TException


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