com.nhncorp.neptune.fs
Class LocalChangeLogFileSystem

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

public class LocalChangeLogFileSystem
extends ChangeLogFileSystem

로컬 파일시스템을 change log 사용. 주로 테스트 용도로 활용

Author:
nhn

Field Summary
 
Fields inherited from interface com.nhncorp.neptune.fs.ChangeLogFileSystemIF
ADD_OK
 
Constructor Summary
LocalChangeLogFileSystem(NConfiguration conf)
           
 
Method Summary
 boolean addChangeLog(java.lang.String src, java.lang.String txId, int seq, ChangeLog changeLog)
          ChangeLog를 저장한다.
 void close(java.lang.String src, boolean append)
          하나의 ChangeLog 레코드를 저장한 다음에 호출된다.
 void delete(java.lang.String src)
          특정 Tablet의 모든 change log 파일을 삭제한다.
 void endMinorCompaction(java.lang.String tabletName)
          MinorCompaction 수행 종료될 때 Changelog 쪽으로 MinorCompaction 종료 상황을 알려주는 역할
 boolean exists(java.lang.String src)
          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)
           
 java.util.List<java.lang.String> getMaxTxIds(java.lang.String tabletName)
           
 java.lang.String getTestHandlerKey()
           
 void init(ChangeLogFileSystemIF systemIF, NConfiguration conf, TabletServerIF tabletServer, com.nhncorp.pleiades.client.LockService lockService)
           
 ChangeLog nextChangeLog(java.lang.String src)
          read 모드로 오픈된 ChangeLog 저장소로부터 ChangeLog 레코드를 읽는다.
 void open(java.lang.String src, boolean append)
          ChangeLog를 저장하기 위해 오픈한다.
 void open(java.lang.String hostName, java.lang.String tabletName, boolean append)
           
 void rollback(java.lang.String tabletName, java.lang.String txId, java.net.InetSocketAddress[] addresses, java.lang.String errorMessage)
           
 boolean rollbackSingleServer(java.lang.String tabletName, java.lang.String txId, java.net.InetSocketAddress addresse)
           
 void startMinorCompaction(java.lang.String tabletName)
          MinorCompaction 수행 시작할 때 Changelog 쪽으로 MinorCompaction 시작 상황을 알려주는 역할
 ChangeLogStatus verifyChangelog(java.lang.String tabletName)
          여러개의 복사본들 사이에 동기화가 되어 있는지 확인한다.
 
Methods inherited from class com.nhncorp.neptune.fs.ChangeLogFileSystem
getChangeLogFileSystem, main
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalChangeLogFileSystem

public LocalChangeLogFileSystem(NConfiguration conf)
Method Detail

delete

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

Throws:
java.io.IOException

exists

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

Returns:
Throws:
java.io.IOException

addChangeLog

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

Throws:
java.io.IOException

close

public void close(java.lang.String src,
                  boolean append)
           throws java.io.IOException
Description copied from interface: ChangeLogFileSystemIF
하나의 ChangeLog 레코드를 저장한 다음에 호출된다. ChangeLog 저장소의 구현에 따라 아무런 작업을 하지 않을 수도 있다.

Throws:
java.io.IOException

nextChangeLog

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

Returns:
Throws:
java.io.IOException

open

public void open(java.lang.String hostName,
                 java.lang.String tabletName,
                 boolean append)
          throws java.io.IOException
Throws:
java.io.IOException

open

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

Throws:
java.io.IOException

verifyChangelog

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

Returns:
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를 관리하는 서버를 반환한다.

Returns:
Throws:
java.io.IOException

init

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

rollback

public void rollback(java.lang.String tabletName,
                     java.lang.String txId,
                     java.net.InetSocketAddress[] addresses,
                     java.lang.String errorMessage)

getTestHandlerKey

public java.lang.String getTestHandlerKey()

getMaxTxIds

public java.util.List<java.lang.String> getMaxTxIds(java.lang.String tabletName)
                                             throws java.io.IOException
Throws:
java.io.IOException

rollbackSingleServer

public boolean rollbackSingleServer(java.lang.String tabletName,
                                    java.lang.String txId,
                                    java.net.InetSocketAddress addresse)

startMinorCompaction

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

Throws:
java.io.IOException

endMinorCompaction

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

Throws:
java.io.IOException

format

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

Throws:
java.io.IOException

getChangeLogStatus

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

finishAdding

public void finishAdding(java.lang.String tabletName,
                         java.lang.String txId)
                  throws java.io.IOException
Throws:
java.io.IOException