com.nhncorp.neptune.changelog.pipe
Class ChangeLogFileChannel

java.lang.Object
  extended by com.nhncorp.neptune.changelog.pipe.ChangeLogFileChannel

public class ChangeLogFileChannel
extends java.lang.Object

Author:
sangchul 하나의 ChangeLogFileChannel 인스턴스는 Tablet하나를 가리킨다. 따라서 만일 하나의 tablet에 동시에 변경 요청이 수신 될 경우 두개 이상의 Pipe가 동시에 하나의 ChangeLogFileChannel 인스턴스에 접근할 수 있다. 따라서 적절한 동기화가 필요하다. 이를테면 쓰기 작업 시 seq 번호를 부여해서 쓰기 순서도 맞춰야 한다.

Method Summary
 void backup()
           
 void close()
           
static ChangeLogFileChannel createChannel(java.lang.String tabletName, java.lang.String path, java.lang.String fileName)
           
 long getFileSize()
           
 boolean isOpen()
           
 void removeBackupFiles()
           
 void removeFile()
           
 void restoreLastLog()
           
 void write(java.nio.ByteBuffer[] bufferArray)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createChannel

public static ChangeLogFileChannel createChannel(java.lang.String tabletName,
                                                 java.lang.String path,
                                                 java.lang.String fileName)
                                          throws java.io.IOException
Throws:
java.io.IOException

isOpen

public boolean isOpen()

write

public void write(java.nio.ByteBuffer[] bufferArray)
           throws java.io.IOException
Throws:
java.io.IOException

close

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

removeFile

public void removeFile()

getFileSize

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

backup

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

restoreLastLog

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

removeBackupFiles

public void removeBackupFiles()