|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.nhncorp.neptune.tabletserver.TabletServer
public class TabletServer
Tablet을 관리하는 메인 서버
Neptune을 구성하는 세가지 데몬(NeptuneMaster, TabletServer, ChangeLogServer) 서버 중 하나이다.
다음과 같은 기능을 수행한다.
| Field Summary | |
|---|---|
static org.apache.commons.logging.Log |
LOG
|
| Fields inherited from interface com.nhncorp.neptune.tabletserver.TabletManagerProtocol |
|---|
versionID |
| Fields inherited from interface com.nhncorp.neptune.tabletserver.DataServiceProtocol |
|---|
versionID |
| Constructor Summary | |
|---|---|
TabletServer()
|
|
| Method Summary | |
|---|---|
void |
addColumn(java.lang.String tableName,
java.lang.String tabletName,
java.lang.String addedColumnName)
|
boolean |
apply(java.lang.String tabletName,
Row.Key rowKey,
TxId txId,
ChangeLog[] changeLogList,
boolean saveLog)
|
void |
assignTablet(TabletInfo tabletInfo)
|
boolean |
canUpload()
|
boolean |
checkServer()
|
void |
commit(TxId txId)
|
void |
commit(TxId txId,
boolean saveLog)
|
void |
commit(TxId txId,
ChangeLog[] changeLogList,
boolean saveLog)
|
void |
deleteColumnValue(TxId txId,
java.lang.String columnName,
Cell.Key columnKey)
|
void |
doActionForTest(java.lang.String tabletName,
java.lang.String action)
|
boolean |
dropTable(java.lang.String taskId,
java.lang.String tableName)
|
java.lang.String |
endBatchUploader(java.lang.String actionId,
java.lang.String tabletName,
java.lang.String[] columnNames,
java.lang.String[] mapFileIds,
java.lang.String[] mapFilePaths)
|
void |
endTabletAssignmentForHandler(TabletInfo tabletInfo,
boolean create)
테스트 코드를 위해 NeptuneMaster로 전송하는 부분을 인터페이스로 빼서 처리. |
boolean |
existsTxId(TxId txId)
|
ColumnValue[][] |
get(java.lang.String tabletName,
Row.Key rowKey)
|
ColumnValue[][] |
get(java.lang.String tabletName,
Row.Key rowKey,
java.lang.String[] columnNames)
|
ColumnValue |
get(java.lang.String tabletName,
Row.Key rowKey,
java.lang.String columnName,
Cell.Key columnKey)
|
RowColumnValues[] |
get(java.lang.String tabletName,
RowFilter scanFilter)
|
java.lang.String[] |
getAllActions(java.lang.String tabletName)
|
ColumnValue[] |
getAllMemoryValues(java.lang.String tabletName,
java.lang.String columnName)
ROOT, META 테이블 검증용으로 사용된다. |
AsyncTaskStatus |
getAsyncTaskStatus(java.lang.String taskId)
|
ColumnValue |
getCloestMetaData(java.lang.String tabletName,
Row.Key rowKey)
해당 rowkey보다 작은 레코드 중 가장 큰 레코드를 조회한다. |
NConfiguration |
getConf()
|
java.lang.String |
getHostName()
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
|
long |
getProtocolVersion(java.lang.String protocol,
long clientVersion)
Return protocol version corresponding to protocol interface. |
TabletServerStatus |
getServerStatus()
|
Row.Key[] |
getSplitedRowKeyRanges(java.lang.String tabletName,
int splitPerTablet)
TabletInputFormat에서 사용하는 메소드로 Tablet의 rowkey 목록에서 splitPerTablet 갯수만큼 범위를 나누어 각 범위의 마지막 rowkey 값을 반환한다. map 갯수 만큼 input 영역을 나누기 위해서 사용한다. |
Tablet |
getTablet(java.lang.String tabletName)
|
TabletReport |
getTabletDetailInfo(java.lang.String tabletName)
|
TabletInfo |
getTabletInfo(java.lang.String tabletName)
|
java.lang.String |
getTabletServerConf(java.lang.String key)
|
java.lang.String |
getTabletServerLockPath()
|
java.lang.String |
getTestHandlerKey()
|
boolean |
hasValue(java.lang.String tabletName,
java.lang.String columnName,
Row.Key rowKey)
Tablet에 rowKey 값이 존재하는 지 반환한다. |
void |
init(TabletServerIF proxyObject,
NConfiguration conf)
|
void |
insertColumnValue(TxId txId,
java.lang.String[] columnNames,
ColumnValue[][] columnValues)
|
void |
insertColumnValue(TxId txId,
java.lang.String columnName,
ColumnValue[] columnValues)
생성된 Row에 컬럼값을 추가한다. |
void |
insertRow(java.lang.String tabletName,
Row.Key rowKey,
java.lang.String[] columnNames,
ColumnValue[][] columnValues)
하나의 row 전체 데이터를 입력한다. |
boolean |
isServicedTablet(java.lang.String tabletName)
TabletServer가 특정 tablet에 대해 DataServer를 하고 있는지 여부를 반환한다. |
boolean |
isShutdowned()
|
static void |
main(java.lang.String[] args)
|
void |
modifyMetaDataForSplit(Tablet targetTablet,
Tablet[] splitedTablets)
|
ColumnValue[] |
next(java.lang.String scannerId)
|
void |
printMeta(java.lang.String tabletName)
|
void |
printTabletInfo(java.lang.String tabletName)
|
void |
removeRow(TxId txId,
long timestamp)
|
TabletInfo[] |
reportTablets()
|
void |
reportTabletSplited(Tablet targetTablet,
Tablet[] splitedTablets)
|
Row.Key |
rollback(TxId txId)
|
void |
run()
|
void |
saveTabletSplitedInfo(java.lang.String tabletName,
TabletInfo targetTablet,
TabletInfo[] splitedTablets)
|
void |
setProperty(java.lang.String key,
java.lang.String value)
|
void |
shutdown()
|
void |
splitForTest(TabletInfo tabletInfo)
|
java.lang.String |
startBatchUploader(java.lang.String tabletName)
|
TxId |
startTx(java.lang.String tabletName,
Row.Key rowKey)
Row에 트렌젝션을 시작한다. |
TxId |
startTx(java.lang.String tabletName,
Row.Key rowKey,
boolean systemTimestamp)
Row에 트렌젝션을 시작한다. |
void |
stopAction(java.lang.String tableName,
java.lang.String tabletActionClassName)
|
void |
stopAllTablets()
|
void |
tabletSplited(Tablet targetTablet,
Tablet[] splitedTablets)
|
java.lang.String |
test(long sleepTime,
java.lang.String echo)
|
ColumnValue[][] |
testRPC()
|
void |
touch(java.lang.String leaseId)
Client API에서 강제적으로 TabletServer에 있는 lease 항목을 touch 한다. |
void |
truncateColumn(java.lang.String tabletName,
java.lang.String columnName)
|
void |
updateColumnValue(TxId txId,
java.lang.String columnName,
ColumnValue[] records)
|
void |
updateOrInsertColumnValue(TxId txId,
java.lang.String columnName,
ColumnValue[] records)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.commons.logging.Log LOG
| Constructor Detail |
|---|
public TabletServer()
| Method Detail |
|---|
public void init(TabletServerIF proxyObject,
NConfiguration conf)
throws java.io.IOException
init in interface TabletServerIFjava.io.IOException
public java.lang.String getTabletServerConf(java.lang.String key)
throws java.io.IOException
getTabletServerConf in interface DataServiceProtocoljava.io.IOExceptionpublic java.lang.String getHostName()
getHostName in interface TabletServerIF
public void printTabletInfo(java.lang.String tabletName)
throws java.io.IOException
printTabletInfo in interface TabletManagerProtocoljava.io.IOException
public java.lang.String[] getAllActions(java.lang.String tabletName)
throws java.io.IOException
getAllActions in interface DataServiceProtocoljava.io.IOExceptionpublic void assignTablet(TabletInfo tabletInfo)
assignTablet in interface TabletManagerProtocolpublic TabletInfo[] reportTablets()
reportTablets in interface TabletManagerProtocol
public void insertRow(java.lang.String tabletName,
Row.Key rowKey,
java.lang.String[] columnNames,
ColumnValue[][] columnValues)
throws java.io.IOException
DataServiceProtocol
insertRow in interface DataServiceProtocoljava.io.IOException
public void insertColumnValue(TxId txId,
java.lang.String columnName,
ColumnValue[] columnValues)
throws java.io.IOException
DataServiceProtocol
insertColumnValue in interface DataServiceProtocoljava.io.IOException
public void insertColumnValue(TxId txId,
java.lang.String[] columnNames,
ColumnValue[][] columnValues)
throws java.io.IOException
insertColumnValue in interface DataServiceProtocoljava.io.IOException
public void commit(TxId txId)
throws java.io.IOException
commit in interface DataServiceProtocoljava.io.IOException
public void commit(TxId txId,
boolean saveLog)
throws java.io.IOException
commit in interface DataServiceProtocoljava.io.IOException
public void commit(TxId txId,
ChangeLog[] changeLogList,
boolean saveLog)
throws java.io.IOException
commit in interface DataServiceProtocoljava.io.IOException
public boolean apply(java.lang.String tabletName,
Row.Key rowKey,
TxId txId,
ChangeLog[] changeLogList,
boolean saveLog)
throws java.io.IOException
apply in interface DataServiceProtocoljava.io.IOException
public TxId startTx(java.lang.String tabletName,
Row.Key rowKey)
throws java.io.IOException
DataServiceProtocol
startTx in interface DataServiceProtocoltabletName - 추가할 row를 서비스하고 있는 tablet명rowKey - 생성하는 row의 key
java.io.IOException
public TxId startTx(java.lang.String tabletName,
Row.Key rowKey,
boolean systemTimestamp)
throws java.io.IOException
DataServiceProtocol
startTx in interface DataServiceProtocoljava.io.IOException
public Row.Key rollback(TxId txId)
throws java.io.IOException
rollback in interface DataServiceProtocoljava.io.IOException
public ColumnValue get(java.lang.String tabletName,
Row.Key rowKey,
java.lang.String columnName,
Cell.Key columnKey)
throws java.io.IOException
get in interface DataServiceProtocoljava.io.IOException
public RowColumnValues[] get(java.lang.String tabletName,
RowFilter scanFilter)
throws java.io.IOException
get in interface DataServiceProtocoljava.io.IOException
public ColumnValue[][] get(java.lang.String tabletName,
Row.Key rowKey)
throws java.io.IOException
get in interface DataServiceProtocoljava.io.IOException
public ColumnValue[][] get(java.lang.String tabletName,
Row.Key rowKey,
java.lang.String[] columnNames)
throws java.io.IOException
get in interface DataServiceProtocoljava.io.IOExceptionpublic Tablet getTablet(java.lang.String tabletName)
getTablet in interface TabletServerIF
public ColumnValue[] next(java.lang.String scannerId)
throws java.io.IOException
java.io.IOException
public void touch(java.lang.String leaseId)
throws java.io.IOException
DataServiceProtocol
touch in interface DataServiceProtocoljava.io.IOException
public void removeRow(TxId txId,
long timestamp)
throws java.io.IOException
removeRow in interface DataServiceProtocoljava.io.IOExceptionpublic void run()
run in interface java.lang.Runnable
public void deleteColumnValue(TxId txId,
java.lang.String columnName,
Cell.Key columnKey)
throws java.io.IOException
deleteColumnValue in interface DataServiceProtocoljava.io.IOException
public boolean existsTxId(TxId txId)
throws java.io.IOException
existsTxId in interface DataServiceProtocoljava.io.IOException
public void updateColumnValue(TxId txId,
java.lang.String columnName,
ColumnValue[] records)
throws java.io.IOException
updateColumnValue in interface DataServiceProtocoljava.io.IOException
public void updateOrInsertColumnValue(TxId txId,
java.lang.String columnName,
ColumnValue[] records)
throws java.io.IOException
updateOrInsertColumnValue in interface DataServiceProtocoljava.io.IOException
public boolean dropTable(java.lang.String taskId,
java.lang.String tableName)
throws java.io.IOException
dropTable in interface TabletManagerProtocoljava.io.IOException
public void tabletSplited(Tablet targetTablet,
Tablet[] splitedTablets)
throws java.io.IOException
tabletSplited in interface TabletServerIFtargetTablet - splitedTablets -
java.io.IOException
public void reportTabletSplited(Tablet targetTablet,
Tablet[] splitedTablets)
throws java.io.IOException
reportTabletSplited in interface TabletServerIFjava.io.IOException
public void modifyMetaDataForSplit(Tablet targetTablet,
Tablet[] splitedTablets)
throws java.io.IOException
modifyMetaDataForSplit in interface TabletServerIFjava.io.IOException
public void saveTabletSplitedInfo(java.lang.String tabletName,
TabletInfo targetTablet,
TabletInfo[] splitedTablets)
throws java.io.IOException
saveTabletSplitedInfo in interface DataServiceProtocoljava.io.IOException
public void stopAllTablets()
throws java.io.IOException
stopAllTablets in interface TabletManagerProtocoljava.io.IOException
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOExceptionpublic TabletInfo getTabletInfo(java.lang.String tabletName)
getTabletInfo in interface DataServiceProtocolgetTabletInfo in interface TabletManagerProtocolpublic boolean isServicedTablet(java.lang.String tabletName)
DataServiceProtocol
isServicedTablet in interface DataServiceProtocol
public ColumnValue getCloestMetaData(java.lang.String tabletName,
Row.Key rowKey)
throws java.io.IOException
DataServiceProtocol
getCloestMetaData in interface DataServiceProtocoljava.io.IOException
public long getProtocolVersion(java.lang.String protocol,
long clientVersion)
throws java.io.IOException
NVersionedProtocol
getProtocolVersion in interface NVersionedProtocolprotocol - The classname of the protocol interfaceclientVersion - The version of the protocol that the client speaks
java.io.IOExceptionpublic boolean checkServer()
checkServer in interface TabletManagerProtocol
public void splitForTest(TabletInfo tabletInfo)
throws java.io.IOException
splitForTest in interface TabletManagerProtocoljava.io.IOException
public void endTabletAssignmentForHandler(TabletInfo tabletInfo,
boolean create)
throws java.io.IOException
endTabletAssignmentForHandler in interface TabletServerIFjava.io.IOException
public void stopAction(java.lang.String tableName,
java.lang.String tabletActionClassName)
throws java.io.IOException
stopAction in interface DataServiceProtocoljava.io.IOExceptionpublic void shutdown()
shutdown in interface TabletManagerProtocol
public java.lang.String startBatchUploader(java.lang.String tabletName)
throws java.io.IOException
startBatchUploader in interface DataServiceProtocoljava.io.IOException
public java.lang.String endBatchUploader(java.lang.String actionId,
java.lang.String tabletName,
java.lang.String[] columnNames,
java.lang.String[] mapFileIds,
java.lang.String[] mapFilePaths)
throws java.io.IOException
endBatchUploader in interface DataServiceProtocoljava.io.IOException
public AsyncTaskStatus getAsyncTaskStatus(java.lang.String taskId)
throws java.io.IOException
getAsyncTaskStatus in interface DataServiceProtocoljava.io.IOException
public void truncateColumn(java.lang.String tabletName,
java.lang.String columnName)
throws java.io.IOException
truncateColumn in interface TabletManagerProtocoljava.io.IOException
public void addColumn(java.lang.String tableName,
java.lang.String tabletName,
java.lang.String addedColumnName)
throws java.io.IOException
addColumn in interface TabletManagerProtocoljava.io.IOExceptionpublic boolean isShutdowned()
isShutdowned in interface TabletServerIF
public java.lang.String test(long sleepTime,
java.lang.String echo)
throws java.io.IOException
test in interface DataServiceProtocoljava.io.IOException
public void printMeta(java.lang.String tabletName)
throws java.io.IOException
printMeta in interface DataServiceProtocoljava.io.IOException
public TabletReport getTabletDetailInfo(java.lang.String tabletName)
throws java.io.IOException
getTabletDetailInfo in interface DataServiceProtocolgetTabletDetailInfo in interface TabletManagerProtocoljava.io.IOException
public boolean canUpload()
throws java.io.IOException
canUpload in interface DataServiceProtocoljava.io.IOException
public void doActionForTest(java.lang.String tabletName,
java.lang.String action)
throws java.io.IOException
doActionForTest in interface TabletManagerProtocoljava.io.IOExceptionpublic java.lang.String getTestHandlerKey()
getTestHandlerKey in interface ProxyObjectpublic ColumnValue[][] testRPC()
testRPC in interface DataServiceProtocol
public void setProperty(java.lang.String key,
java.lang.String value)
throws java.io.IOException
setProperty in interface TabletManagerProtocoljava.io.IOException
public java.lang.String getProperty(java.lang.String key,
java.lang.String defaultValue)
throws java.io.IOException
getProperty in interface TabletManagerProtocoljava.io.IOException
public ColumnValue[] getAllMemoryValues(java.lang.String tabletName,
java.lang.String columnName)
throws java.io.IOException
DataServiceProtocol
getAllMemoryValues in interface DataServiceProtocoljava.io.IOExceptionpublic NConfiguration getConf()
public java.lang.String getTabletServerLockPath()
public TabletServerStatus getServerStatus()
throws java.io.IOException
getServerStatus in interface TabletManagerProtocoljava.io.IOException
public boolean hasValue(java.lang.String tabletName,
java.lang.String columnName,
Row.Key rowKey)
throws java.io.IOException
DataServiceProtocol
hasValue in interface DataServiceProtocoljava.io.IOException
public Row.Key[] getSplitedRowKeyRanges(java.lang.String tabletName,
int splitPerTablet)
throws java.io.IOException
DataServiceProtocol
getSplitedRowKeyRanges in interface DataServiceProtocoljava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||