com.nhncorp.neptune.changelog
Class ChangeLogClient

java.lang.Object
  extended by com.nhncorp.neptune.changelog.ChangeLogClient

public class ChangeLogClient
extends java.lang.Object


Constructor Summary
ChangeLogClient(NConfiguration conf, java.lang.String tabletName)
           
ChangeLogClient(NConfiguration conf, java.lang.String tabletName, java.net.InetSocketAddress[] addresses)
           
 
Method Summary
 void append(ChangeLog changeLog)
           
 void backupLogFile()
           
 void close()
           
 int commitWriting()
           
 void disconnect()
           
static void formatLogsAt(NConfiguration conf, java.net.InetSocketAddress addr)
           
 boolean getConsistencyCheck()
           
 long getLogFileSize()
           
 java.lang.String getPipeKey()
           
 java.lang.String getTabletName()
           
 boolean hasInvalidChangeLog()
           
 boolean isClosed()
           
 boolean isExpired()
           
 boolean isWritingStarted()
           
 void open()
           
 void prepareClosing()
           
 TransactionData[] readAllLogFiles()
           
 TransactionData[] readLastLogFile()
           
 void removeAllLogs()
           
 void removeBackupLogFiles()
           
 void rollback()
           
 void setConsistencyCheck(boolean flag)
           
 void startWriting(java.lang.String id)
           
 boolean tabletExists()
           
 void test_rollbackFileAtIndex(int index)
           
 ChangeLogClient touch()
           
 void write(byte[] bytes)
           
 void write(byte[] bytes, int offset, int length)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeLogClient

public ChangeLogClient(NConfiguration conf,
                       java.lang.String tabletName)
                throws java.io.IOException
Throws:
java.io.IOException

ChangeLogClient

public ChangeLogClient(NConfiguration conf,
                       java.lang.String tabletName,
                       java.net.InetSocketAddress[] addresses)
                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getTabletName

public java.lang.String getTabletName()

getPipeKey

public java.lang.String getPipeKey()

open

public void open()
          throws UnmatchedLogException,
                 ChangeLogInterruptedException,
                 java.io.IOException
Throws:
UnmatchedLogException
ChangeLogInterruptedException
java.io.IOException

startWriting

public void startWriting(java.lang.String id)
                  throws ChangeLogInterruptedException,
                         java.io.IOException
Throws:
ChangeLogInterruptedException
java.io.IOException

append

public void append(ChangeLog changeLog)

write

public void write(byte[] bytes)

write

public void write(byte[] bytes,
                  int offset,
                  int length)

commitWriting

public int commitWriting()
                  throws ChangeLogInterruptedException,
                         java.io.IOException
Throws:
ChangeLogInterruptedException
java.io.IOException

tabletExists

public boolean tabletExists()
                     throws java.io.IOException
Throws:
java.io.IOException

prepareClosing

public void prepareClosing()
                    throws java.io.IOException
Throws:
java.io.IOException

disconnect

public void disconnect()
                throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

removeAllLogs

public void removeAllLogs()
                   throws java.io.IOException
Throws:
java.io.IOException

removeBackupLogFiles

public void removeBackupLogFiles()
                          throws java.io.IOException
Throws:
java.io.IOException

rollback

public void rollback()
              throws java.io.IOException
Throws:
java.io.IOException

backupLogFile

public void backupLogFile()
                   throws java.io.IOException
Throws:
java.io.IOException

readLastLogFile

public TransactionData[] readLastLogFile()
                                  throws java.io.IOException
Throws:
java.io.IOException

readAllLogFiles

public TransactionData[] readAllLogFiles()
                                  throws java.io.IOException
Throws:
java.io.IOException

getLogFileSize

public long getLogFileSize()
                    throws java.io.IOException
Throws:
java.io.IOException

test_rollbackFileAtIndex

public void test_rollbackFileAtIndex(int index)

isClosed

public boolean isClosed()

isWritingStarted

public boolean isWritingStarted()

isExpired

public boolean isExpired()

touch

public ChangeLogClient touch()

formatLogsAt

public static void formatLogsAt(NConfiguration conf,
                                java.net.InetSocketAddress addr)
                         throws java.io.IOException
Throws:
java.io.IOException

setConsistencyCheck

public void setConsistencyCheck(boolean flag)

getConsistencyCheck

public boolean getConsistencyCheck()

hasInvalidChangeLog

public boolean hasInvalidChangeLog()
                            throws java.io.IOException
Throws:
java.io.IOException