com.nhncorp.neptune.fs.old
Class FileBasedChangeLogFileSystem

java.lang.Object
  extended by com.nhncorp.neptune.fs.old.FileBasedChangeLogFileSystem
All Implemented Interfaces:
ProxyObject, ChangeLogFileSystemIF

public class FileBasedChangeLogFileSystem
extends java.lang.Object
implements ChangeLogFileSystemIF


Field Summary
static org.apache.commons.logging.Log LOG
           
static int LOG_TX_TIMEOUT
           
 
Fields inherited from interface com.nhncorp.neptune.fs.ChangeLogFileSystemIF
ADD_OK
 
Constructor Summary
FileBasedChangeLogFileSystem()
           
 
Method Summary
 boolean addChangeLog(java.lang.String tabletName, java.lang.String txId, int seq, ChangeLog changeLog)
          ChangeLog를 저장한다.
 void close(java.lang.String tabletName, boolean writable)
          Changelog server에 장애가 있는지 확인하여 장애가 있는 경우 kill 시키고, log file image 정보에서 해당 목록을 삭제한다.
 void delete(java.lang.String tabletName)
          특정 Tablet의 모든 change log 파일을 삭제한다.
 void deleteAll()
           
 void endMinorCompaction(java.lang.String tabletName)
          MinorCompaction 수행 종료될 때 Changelog 쪽으로 MinorCompaction 종료 상황을 알려주는 역할
 boolean exists(java.lang.String tabletName)
          change log 파일의 존재 여부를 반환한다.
 void finishAdding(java.lang.String tabletName, java.lang.String txId)
           
 void format()
          관리하는 모든 정보를 삭제한다.
 java.net.InetSocketAddress[] getChangeLogServerInfo(java.lang.String tabletName)
          해당 Tablet의 log를 관리하는 서버를 반환한다.
 java.util.List<ChangeLogStatus> getChangeLogStatus(java.lang.String tabletName)
           
 TabletServerIF getTabletServer()
           
 java.lang.String getTestHandlerKey()
           
 void init(ChangeLogFileSystemIF proxyObject, NConfiguration conf, TabletServerIF tabletServer, com.nhncorp.pleiades.client.LockService lockService)
           
 java.lang.String[] list()
           
 ChangeLog nextChangeLog(java.lang.String tabletName)
          read 모드로 오픈된 ChangeLog 저장소로부터 ChangeLog 레코드를 읽는다.
 void open(java.lang.String tabletName, boolean writable)
          ChangeLog를 저장하기 위해 오픈한다.
 void open(java.lang.String hostName, java.lang.String tabletName, boolean writable)
           
 void startMinorCompaction(java.lang.String tabletName)
          MinorCompaction 수행 시작할 때 Changelog 쪽으로 MinorCompaction 시작 상황을 알려주는 역할
 ChangeLogStatus verifyChangelog(java.lang.String tabletName)
          여러개의 복사본들 사이에 동기화가 되어 있는지 확인한다.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

LOG_TX_TIMEOUT

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

FileBasedChangeLogFileSystem

public FileBasedChangeLogFileSystem()
Method Detail

init

public void init(ChangeLogFileSystemIF proxyObject,
                 NConfiguration conf,
                 TabletServerIF tabletServer,
                 com.nhncorp.pleiades.client.LockService lockService)
          throws java.io.IOException
Specified by:
init in interface ChangeLogFileSystemIF
Throws:
java.io.IOException

addChangeLog

public boolean addChangeLog(java.lang.String tabletName,
                            java.lang.String txId,
                            int seq,
                            ChangeLog changeLog)
                     throws java.io.IOException
Description copied from interface: ChangeLogFileSystemIF
ChangeLog를 저장한다.

Specified by:
addChangeLog in interface ChangeLogFileSystemIF
Throws:
java.io.IOException

close

public void close(java.lang.String tabletName,
                  boolean writable)
           throws java.io.IOException
Changelog server에 장애가 있는지 확인하여 장애가 있는 경우 kill 시키고, log file image 정보에서 해당 목록을 삭제한다.

Specified by:
close in interface ChangeLogFileSystemIF
Throws:
java.io.IOException

delete

public void delete(java.lang.String tabletName)
            throws java.io.IOException
Description copied from interface: ChangeLogFileSystemIF
특정 Tablet의 모든 change log 파일을 삭제한다.

Specified by:
delete in interface ChangeLogFileSystemIF
Throws:
java.io.IOException

exists

public boolean exists(java.lang.String tabletName)
               throws java.io.IOException
Description copied from interface: ChangeLogFileSystemIF
change log 파일의 존재 여부를 반환한다.

Specified by:
exists in interface ChangeLogFileSystemIF
Returns:
Throws:
java.io.IOException

list

public java.lang.String[] list()
                        throws java.io.IOException
Throws:
java.io.IOException

nextChangeLog

public ChangeLog nextChangeLog(java.lang.String tabletName)
                        throws java.io.IOException
Description copied from interface: ChangeLogFileSystemIF
read 모드로 오픈된 ChangeLog 저장소로부터 ChangeLog 레코드를 읽는다.

Specified by:
nextChangeLog in interface ChangeLogFileSystemIF
Returns:
Throws:
java.io.IOException

open

public void open(java.lang.String hostName,
                 java.lang.String tabletName,
                 boolean writable)
          throws java.io.IOException
Specified by:
open in interface ChangeLogFileSystemIF
Throws:
java.io.IOException

open

public void open(java.lang.String tabletName,
                 boolean writable)
          throws java.io.IOException
Description copied from interface: ChangeLogFileSystemIF
ChangeLog를 저장하기 위해 오픈한다.

Specified by:
open in interface ChangeLogFileSystemIF
Throws:
java.io.IOException

getChangeLogServerInfo

public java.net.InetSocketAddress[] getChangeLogServerInfo(java.lang.String tabletName)
                                                    throws java.io.IOException
Description copied from interface: ChangeLogFileSystemIF
해당 Tablet의 log를 관리하는 서버를 반환한다.

Specified by:
getChangeLogServerInfo in interface ChangeLogFileSystemIF
Returns:
Throws:
java.io.IOException

verifyChangelog

public ChangeLogStatus verifyChangelog(java.lang.String tabletName)
                                throws java.io.IOException
Description copied from interface: ChangeLogFileSystemIF
여러개의 복사본들 사이에 동기화가 되어 있는지 확인한다. 서로 동기화가 맞지 않는 경우 txid가 가장 낮은 값을 기준으로 sync 작업을 수행한다. 결과 값은 sync의 성공 여부

Specified by:
verifyChangelog in interface ChangeLogFileSystemIF
Returns:
Throws:
java.io.IOException

getChangeLogStatus

public java.util.List<ChangeLogStatus> getChangeLogStatus(java.lang.String tabletName)
                                                   throws java.io.IOException
Specified by:
getChangeLogStatus in interface ChangeLogFileSystemIF
Returns:
Throws:
java.io.IOException

getTabletServer

public TabletServerIF getTabletServer()

getTestHandlerKey

public java.lang.String getTestHandlerKey()
Specified by:
getTestHandlerKey in interface ProxyObject

deleteAll

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

format

public void format()
            throws java.io.IOException
Description copied from interface: ChangeLogFileSystemIF
관리하는 모든 정보를 삭제한다.

Specified by:
format in interface ChangeLogFileSystemIF
Throws:
java.io.IOException

startMinorCompaction

public void startMinorCompaction(java.lang.String tabletName)
                          throws java.io.IOException
Description copied from interface: ChangeLogFileSystemIF
MinorCompaction 수행 시작할 때 Changelog 쪽으로 MinorCompaction 시작 상황을 알려주는 역할

Specified by:
startMinorCompaction in interface ChangeLogFileSystemIF
Throws:
java.io.IOException

endMinorCompaction

public void endMinorCompaction(java.lang.String tabletName)
                        throws java.io.IOException
Description copied from interface: ChangeLogFileSystemIF
MinorCompaction 수행 종료될 때 Changelog 쪽으로 MinorCompaction 종료 상황을 알려주는 역할

Specified by:
endMinorCompaction in interface ChangeLogFileSystemIF
Throws:
java.io.IOException

finishAdding

public void finishAdding(java.lang.String tabletName,
                         java.lang.String txId)
                  throws java.io.IOException
Specified by:
finishAdding in interface ChangeLogFileSystemIF
Throws:
java.io.IOException