com.nhncorp.neptune.changelog
Class ChangeLogServer

java.lang.Object
  extended by com.nhncorp.neptune.changelog.ChangeLogServer
All Implemented Interfaces:
ChangeLogServerIF, NVersionedProtocol

public class ChangeLogServer
extends java.lang.Object
implements ChangeLogServerIF


Field Summary
static boolean IS_TEST_MODE
           
static int PORT_DIFF
           
static int TIMEOUT
           
 
Fields inherited from interface com.nhncorp.neptune.changelog.ChangeLogServerIF
REPORT_TIME, versionID
 
Constructor Summary
ChangeLogServer(NConfiguration conf)
           
 
Method Summary
 java.lang.String backupLogFile(java.lang.String tabletName)
           
 void closeAll(java.lang.String tabletName)
           
 void closePipe(java.lang.String tabletName, java.lang.String pipeKey)
           
 java.lang.String fini(java.lang.String tabletName, int bytes)
           
 void format()
           
 long getChecksum(java.lang.String tabletName)
           
 long getLogFileSize(java.lang.String tabletName)
           
 int getPort()
           
 long getProtocolVersion(java.lang.String protocol, long clientVersion)
          Return protocol version corresponding to protocol interface.
static void main(java.lang.String[] args)
           
 int readAllLogs(java.lang.String tabletName)
           
 int readLastLog(java.lang.String tabletName)
           
 java.lang.String removeAllLogs(java.lang.String tabletName)
           
 void removeBackupLogs(java.lang.String tabletName)
           
 void restoreLogFile(java.lang.String tabletName)
           
 java.lang.String rollback(java.lang.String tabletName, java.lang.String position)
           
 void start()
           
 void stop()
           
 void stopChangeLogServer()
           
 java.lang.String tabletExists(java.lang.String tabletName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IS_TEST_MODE

public static boolean IS_TEST_MODE

TIMEOUT

public static final int TIMEOUT
See Also:
Constant Field Values

PORT_DIFF

public static final int PORT_DIFF
See Also:
Constant Field Values
Constructor Detail

ChangeLogServer

public ChangeLogServer(NConfiguration conf)
                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

start

public void start()
           throws java.io.IOException
Specified by:
start in interface ChangeLogServerIF
Throws:
java.io.IOException

stop

public void stop()

getPort

public int getPort()

main

public static void main(java.lang.String[] args)

getProtocolVersion

public long getProtocolVersion(java.lang.String protocol,
                               long clientVersion)
                        throws java.io.IOException
Description copied from interface: NVersionedProtocol
Return protocol version corresponding to protocol interface.

Specified by:
getProtocolVersion in interface NVersionedProtocol
Parameters:
protocol - The classname of the protocol interface
clientVersion - The version of the protocol that the client speaks
Returns:
the version that the server will speak
Throws:
java.io.IOException

fini

public java.lang.String fini(java.lang.String tabletName,
                             int bytes)
Specified by:
fini in interface ChangeLogServerIF

rollback

public java.lang.String rollback(java.lang.String tabletName,
                                 java.lang.String position)
Specified by:
rollback in interface ChangeLogServerIF

backupLogFile

public java.lang.String backupLogFile(java.lang.String tabletName)
Specified by:
backupLogFile in interface ChangeLogServerIF

restoreLogFile

public void restoreLogFile(java.lang.String tabletName)
Specified by:
restoreLogFile in interface ChangeLogServerIF

format

public void format()
Specified by:
format in interface ChangeLogServerIF

removeAllLogs

public java.lang.String removeAllLogs(java.lang.String tabletName)
                               throws java.io.IOException
Specified by:
removeAllLogs in interface ChangeLogServerIF
Throws:
java.io.IOException

removeBackupLogs

public void removeBackupLogs(java.lang.String tabletName)
                      throws java.io.IOException
Specified by:
removeBackupLogs in interface ChangeLogServerIF
Throws:
java.io.IOException

getLogFileSize

public long getLogFileSize(java.lang.String tabletName)
Specified by:
getLogFileSize in interface ChangeLogServerIF

closePipe

public void closePipe(java.lang.String tabletName,
                      java.lang.String pipeKey)
Specified by:
closePipe in interface ChangeLogServerIF

closeAll

public void closeAll(java.lang.String tabletName)
Specified by:
closeAll in interface ChangeLogServerIF

stopChangeLogServer

public void stopChangeLogServer()
Specified by:
stopChangeLogServer in interface ChangeLogServerIF

readAllLogs

public int readAllLogs(java.lang.String tabletName)
Specified by:
readAllLogs in interface ChangeLogServerIF

readLastLog

public int readLastLog(java.lang.String tabletName)
Specified by:
readLastLog in interface ChangeLogServerIF

tabletExists

public java.lang.String tabletExists(java.lang.String tabletName)
Specified by:
tabletExists in interface ChangeLogServerIF

getChecksum

public long getChecksum(java.lang.String tabletName)
                 throws java.io.IOException
Specified by:
getChecksum in interface ChangeLogServerIF
Throws:
java.io.IOException