com.nhncorp.neptune.fs
Class PipeBasedChangeLogFileSystem

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

public class PipeBasedChangeLogFileSystem
extends java.lang.Object
implements ChangeLogFileSystemIF

Changelog 처리를 위한 파일시스템 클라이언트 현재 구성은 Neptune에서 자체 개발된 고속의 append 가능한 change log용 파일시스템을 별도로 구축하여 사용하고 있다.

Author:
nhn

Field Summary
 
Fields inherited from interface com.nhncorp.neptune.fs.ChangeLogFileSystemIF
ADD_OK
 
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 레코드를 저장한 다음에 호출된다.
 void delete(java.lang.String tabletName)
          특정 Tablet의 모든 change log 파일을 삭제한다.
 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)
           
 java.lang.String getTestHandlerKey()
           
 void init(ChangeLogFileSystemIF systemIF, NConfiguration conf, TabletServerIF tabletServer, com.nhncorp.pleiades.client.LockService lockService)
           
 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
 

Method Detail

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

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

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

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

close

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

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

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

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

format

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

Specified by:
format 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

init

public void init(ChangeLogFileSystemIF systemIF,
                 NConfiguration conf,
                 TabletServerIF tabletServer,
                 com.nhncorp.pleiades.client.LockService lockService)
          throws java.io.IOException
Specified by:
init in interface ChangeLogFileSystemIF
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

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

getTestHandlerKey

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

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