com.nhncorp.neptune.changelog.previous
Class FileChangeLogServer

java.lang.Object
  extended by com.nhncorp.neptune.changelog.previous.FileChangeLogServer
All Implemented Interfaces:
FileChangeLogServerIF, ProxyObject, Constants, NVersionedProtocol, java.lang.Runnable

public class FileChangeLogServer
extends java.lang.Object
implements FileChangeLogServerIF


Field Summary
static org.apache.commons.logging.Log LOG
           
 
Fields inherited from interface com.nhncorp.neptune.changelog.previous.FileChangeLogServerIF
versionID
 
Fields inherited from interface com.nhncorp.neptune.common.Constants
BATCH_RECEIVER_SUCCESS, BATCH_UPLOAD, CHANGELOG_SERVER, COMPACTION, DELETEED, END_RECEIVE_ROW, GROUPS, INDEX_INTERVAL_LENGH, INSERTED, LOG_OP_ADD_COLUMN_VALUE, LOG_OP_CREATE_ROW, LOG_OP_DELETE_COLUMN_VALUE, LOG_OP_MODIFY_META, MAP_RECORD_COLUMN, MAP_RECORD_ROW, MASTER, MASTER_SERVER, MAX_KEY_LENGTH, MAX_VALUE, META_COLUMN_NAME_TABLETINFO, MIN_VALUE, NEPTUNE, OPEN_SCANNER, PATH_SCHEMA, PIPE_CL_FILE_NAME, PROCESS, ROOT_TABLET, SCANNER_END, SCANNER_OPEN_FAIL, SCANNER_OPEN_SUCCESS, SCHEMA_DESCRIPTION_FILE_NAME, SCHEMA_INFO_FILENAME, SERVER, SPLIT, SPLIT_INFO, SPLIT_STORE, SUPERGROUP, TABLE_DROP, TABLE_LOCK, TABLE_NAME_META, TABLE_NAME_ROOT, TABLET_ALIVE, TABLET_ASSIGN, TABLET_AVAIL, TABLET_CREATED, TABLET_DROP, TABLET_FAIL, TABLET_STOP_MARK, TABLETSERVER_SPLIT, TEST_MODE, UPLOAD_END, UPLOAD_FAIL, UPLOAD_START_ROW, UPLOADER, USERS
 
Constructor Summary
FileChangeLogServer()
           
 
Method Summary
 java.lang.String addChangeLog(java.lang.String tabletName, java.lang.String txId, int seq, ChangeLog changeLog)
           
 void close(java.lang.String tabletName, boolean writable)
           
 void delete(java.lang.String tabletName)
           
static void doFormat()
          only for test case
 boolean endMinorCompaction(java.lang.String tabletName)
           
 void format()
           
 ChangeLogStatus getChangeLogStatus(java.lang.String tabletName)
           
 java.lang.String getHostName()
           
 long getProtocolVersion(java.lang.String protocol, long clientVersion)
          Return protocol version corresponding to protocol interface.
 java.lang.String getTestHandlerKey()
           
 void init(FileChangeLogServerIF changeLogServer, NConfiguration configuration)
           
 boolean isShutdowned()
           
static void main(java.lang.String[] args)
           
 ChangeLog nextChangeLog(java.lang.String tabletName)
          ChangeLog 파일로 부터 ChangeLog 레코드를 읽는다.
 void run()
           
 void shutdown()
           
 boolean startMinorCompaction(java.lang.String tabletName)
           
 java.lang.String test()
           
 
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
Constructor Detail

FileChangeLogServer

public FileChangeLogServer()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException

getProtocolVersion

public long getProtocolVersion(java.lang.String protocol,
                               long clientVersion)
                        throws java.io.IOException
Description copied from interface: NVersionedProtocol
Return protocol version corresponding to protocol interface.

Specified by:
getProtocolVersion in interface NVersionedProtocol
Parameters:
protocol - The classname of the protocol interface
clientVersion - The version of the protocol that the client speaks
Returns:
the version that the server will speak
Throws:
java.io.IOException

init

public void init(FileChangeLogServerIF changeLogServer,
                 NConfiguration configuration)
          throws java.io.IOException
Specified by:
init in interface FileChangeLogServerIF
Throws:
java.io.IOException

run

public void run()
Specified by:
run in interface java.lang.Runnable

addChangeLog

public java.lang.String addChangeLog(java.lang.String tabletName,
                                     java.lang.String txId,
                                     int seq,
                                     ChangeLog changeLog)
                              throws java.io.IOException
Specified by:
addChangeLog in interface FileChangeLogServerIF
Throws:
java.io.IOException

close

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

startMinorCompaction

public boolean startMinorCompaction(java.lang.String tabletName)
                             throws java.io.IOException
Specified by:
startMinorCompaction in interface FileChangeLogServerIF
Throws:
java.io.IOException

endMinorCompaction

public boolean endMinorCompaction(java.lang.String tabletName)
                           throws java.io.IOException
Specified by:
endMinorCompaction in interface FileChangeLogServerIF
Throws:
java.io.IOException

format

public void format()
            throws java.io.IOException
Specified by:
format in interface FileChangeLogServerIF
Throws:
java.io.IOException

getHostName

public java.lang.String getHostName()
Specified by:
getHostName in interface FileChangeLogServerIF

getChangeLogStatus

public ChangeLogStatus getChangeLogStatus(java.lang.String tabletName)
                                   throws java.io.IOException
Specified by:
getChangeLogStatus in interface FileChangeLogServerIF
Throws:
java.io.IOException

isShutdowned

public boolean isShutdowned()

nextChangeLog

public ChangeLog nextChangeLog(java.lang.String tabletName)
                        throws java.io.IOException
ChangeLog 파일로 부터 ChangeLog 레코드를 읽는다. MinorCompaction 처리 중에 kill 된 경우에는 파일이 2개이기 때문에 2개 모두 처리한다. 순서는 OLD -> NEW

Specified by:
nextChangeLog in interface FileChangeLogServerIF
Parameters:
tabletName -
Returns:
Throws:
java.io.IOException

delete

public void delete(java.lang.String tabletName)
            throws java.io.IOException
Specified by:
delete in interface FileChangeLogServerIF
Throws:
java.io.IOException

shutdown

public void shutdown()
Specified by:
shutdown in interface FileChangeLogServerIF

test

public java.lang.String test()

getTestHandlerKey

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

doFormat

public static void doFormat()
                     throws java.io.IOException
only for test case

Throws:
java.io.IOException