|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.nhncorp.neptune.master.NeptuneMaster
public class NeptuneMaster
Neptune의 클러스터를 관리하는 Master
NeptuneMaster의 역할은 Tablet을 할당해주는 역할만 수행한다. 따라서 NeptuneMaster에 장애가 발생해도 데이터 서비스(get, put)은 정상 서비스 가능하다.
| Field Summary | |
|---|---|
static org.apache.commons.logging.Log |
LOG
|
static NeptuneMaster |
neptuneMaster
|
| Fields inherited from interface com.nhncorp.neptune.master.TableManagerProtocol |
|---|
versionID |
| Fields inherited from interface com.nhncorp.neptune.master.TabletMasterProtocol |
|---|
versionID |
| Constructor Summary | |
|---|---|
NeptuneMaster()
|
|
| Method Summary | |
|---|---|
void |
addColumn(java.lang.String tableName,
java.lang.String addedColumnName)
테이블에 컬럼을 추가한다. |
void |
addTablePermission(java.lang.String tableName,
java.lang.String userId,
java.lang.String readWrite)
|
TabletInfo |
addTablet(java.lang.String tableName,
Row.Key endRowKey)
테이블에 새로운 Tablet을 추가한다. |
void |
addUser(java.lang.String userId)
|
boolean |
assignTablet(TabletInfo tabletInfo)
Tablet을 tablet server에 할당한다. ignoreFlag는 tablet이 현재 다른 tabletserver에 의해 로딩중이거나 서비스중에 상관없이 지정된 tablet server로 할당된다. |
boolean |
checkServer()
|
void |
createTable(TableSchema table,
Row.Key[] endRowKeys)
테이블을 생성한다. endRowKeys에 초기에 생성할 tablet에 대한 목록이 있는 경우 tablet을 여러개 생성시키고 그렇지 않는 경우 min ~ max 범위를 저장하는 하나의 tablet만 생성한다. |
static boolean |
doFormat(NConfiguration conf)
모든 데이터 및 스키마를 삭제한다. |
java.lang.String |
dropTable(java.lang.String tableName)
테이블을 drop한다. |
void |
endTableDrop(java.lang.String taskId,
java.lang.String hostName,
java.lang.String tableName)
|
void |
endTabletAssignment(TabletInfo tabletInfo,
boolean created)
|
void |
endTabletAssignmentForHandler(TabletInfo tabletInfo,
boolean created)
Proxy를 이용해서 테스트 코드를 작성하기 위해 인터페이스로 빼서 처리, 실제는 endTabletAssignment 처리 |
void |
errorTableDrop(java.lang.String taskId,
java.lang.String hostName,
java.lang.String tableName,
java.lang.String message)
|
void |
errorTabletAssignment(java.lang.String hostName,
TabletInfo tabletInfo)
Tablet할당 에러 발생시 다음과 같이 처리한다. 1. |
static java.lang.String |
finalizeDrop(NeptuneMaster neptuneMaster,
NConfiguration conf,
NeptuneFileSystem fs,
com.nhncorp.pleiades.client.LockService lockService,
java.lang.String tableName,
boolean forced)
|
static void |
forcedDropTable(java.lang.String tableName)
lock, schema 존재여부 상관없이 drop 처리 |
static void |
format()
모든 데이터 및 스키마를 삭제한다. |
static void |
formatFileSystem(NConfiguration conf)
|
AsyncTaskStatus |
getAsyncTaskStatus(java.lang.String taskId)
|
NConfiguration |
getConf()
|
java.lang.String |
getHostName()
|
static java.lang.String |
getMasterServerHostName(com.nhncorp.pleiades.client.LockService lockService)
master가 실행되고 있는 서버 정보를 반환한다. |
long |
getProtocolVersion(java.lang.String protocol,
long clientVersion)
Return protocol version corresponding to protocol interface. |
TabletInfo[] |
getTablets(java.lang.String tableName)
특정 테이블의 Tablet 목록을 조회한다. |
TabletServerInfo[] |
getTabletServerInfos()
|
java.lang.String |
getTestHandlerKey()
|
void |
init(NeptuneMasterIF proxyObject,
NConfiguration conf)
|
static boolean |
isClusterReady()
ROOT, META가 모두 로딩된 상태 |
boolean |
isShutdowned()
|
TableSchema[] |
listTables()
테이블 목록을 조회한다. |
static void |
main(java.lang.String[] args)
|
void |
removeAsyncTask(java.lang.String taskId)
|
void |
removeTablePermission(java.lang.String tableName,
java.lang.String userId)
|
void |
removeUser(java.lang.String userId)
|
void |
reportTabletServerStarted(java.lang.String hostName)
네트워크 설정 문제로 Pleiades event handler를 사용하지 못할 경우 TabletServer가 NeptuneMaster로 live 상태를 전송한다. |
void |
reportTabletSplited(TabletInfo targetTablet,
TabletInfo[] splitedTablets)
|
void |
run()
NeptuneMaster main thread |
void |
shutdown()
|
void |
test()
|
boolean |
tryMasterLock()
|
| 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
public static NeptuneMaster neptuneMaster
| Constructor Detail |
|---|
public NeptuneMaster()
| Method Detail |
|---|
public void init(NeptuneMasterIF proxyObject,
NConfiguration conf)
throws java.io.IOException
init in interface NeptuneMasterIFjava.io.IOExceptionpublic void run()
run in interface java.lang.Runnable
public boolean tryMasterLock()
throws java.io.IOException
tryMasterLock in interface NeptuneMasterIFjava.io.IOException
public static boolean isClusterReady()
throws java.io.IOException
java.io.IOException
public static java.lang.String getMasterServerHostName(com.nhncorp.pleiades.client.LockService lockService)
throws java.io.IOException
conf -
java.io.IOException
public static void format()
throws java.io.IOException
java.io.IOException
public static void formatFileSystem(NConfiguration conf)
throws java.io.IOException
java.io.IOException
public static boolean doFormat(NConfiguration conf)
throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args)
throws java.io.IOException
args -
java.io.IOException
public static void forcedDropTable(java.lang.String tableName)
throws java.io.IOException
tableName -
java.io.IOException
public void addColumn(java.lang.String tableName,
java.lang.String addedColumnName)
throws java.io.IOException
addColumn in interface TableManagerProtocoljava.io.IOException
public TabletInfo addTablet(java.lang.String tableName,
Row.Key endRowKey)
throws java.io.IOException
TableManagerProtocol
addTablet in interface TableManagerProtocoljava.io.IOException
public void createTable(TableSchema table,
Row.Key[] endRowKeys)
throws java.io.IOException
createTable in interface TableManagerProtocoltable - endRowKeys -
java.io.IOException
public boolean assignTablet(TabletInfo tabletInfo)
throws java.io.IOException
assignTablet in interface TabletMasterProtocoljava.io.IOException
public AsyncTaskStatus getAsyncTaskStatus(java.lang.String taskId)
throws java.io.IOException
getAsyncTaskStatus in interface AsyncCallProtocoljava.io.IOException
public void removeAsyncTask(java.lang.String taskId)
throws java.io.IOException
removeAsyncTask in interface AsyncCallProtocoljava.io.IOException
public java.lang.String dropTable(java.lang.String tableName)
throws java.io.IOException
TableManagerProtocol
dropTable in interface TableManagerProtocoljava.io.IOException
public static java.lang.String finalizeDrop(NeptuneMaster neptuneMaster,
NConfiguration conf,
NeptuneFileSystem fs,
com.nhncorp.pleiades.client.LockService lockService,
java.lang.String tableName,
boolean forced)
throws java.io.IOException
java.io.IOException
public void endTableDrop(java.lang.String taskId,
java.lang.String hostName,
java.lang.String tableName)
throws java.io.IOException
endTableDrop in interface TabletMasterProtocoljava.io.IOException
public void errorTableDrop(java.lang.String taskId,
java.lang.String hostName,
java.lang.String tableName,
java.lang.String message)
throws java.io.IOException
errorTableDrop in interface TabletMasterProtocoljava.io.IOExceptionpublic TabletInfo[] getTablets(java.lang.String tableName)
TableManagerProtocol
getTablets in interface TableManagerProtocolpublic TableSchema[] listTables()
TableManagerProtocol
listTables in interface TableManagerProtocol
public void endTabletAssignment(TabletInfo tabletInfo,
boolean created)
throws java.io.IOException
endTabletAssignment in interface TabletMasterProtocoljava.io.IOException
public void endTabletAssignmentForHandler(TabletInfo tabletInfo,
boolean created)
throws java.io.IOException
endTabletAssignmentForHandler in interface NeptuneMasterIFjava.io.IOException
public void errorTabletAssignment(java.lang.String hostName,
TabletInfo tabletInfo)
errorTabletAssignment in interface TabletMasterProtocol
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 TabletMasterProtocol
public void reportTabletSplited(TabletInfo targetTablet,
TabletInfo[] splitedTablets)
reportTabletSplited in interface TabletMasterProtocolpublic void shutdown()
shutdown in interface NeptuneMasterIFpublic boolean isShutdowned()
isShutdowned in interface NeptuneMasterIF
public void reportTabletServerStarted(java.lang.String hostName)
throws java.io.IOException
TabletMasterProtocol
reportTabletServerStarted in interface TabletMasterProtocoljava.io.IOExceptionpublic java.lang.String getHostName()
getHostName in interface NeptuneMasterIFpublic java.lang.String getTestHandlerKey()
getTestHandlerKey in interface ProxyObjectpublic void test()
test in interface TableManagerProtocolpublic NConfiguration getConf()
getConf in interface NeptuneMasterIFpublic TabletServerInfo[] getTabletServerInfos()
getTabletServerInfos in interface TableManagerProtocol
public void addUser(java.lang.String userId)
throws java.io.IOException
addUser in interface TableManagerProtocoljava.io.IOException
public void removeUser(java.lang.String userId)
throws java.io.IOException
removeUser in interface TableManagerProtocoljava.io.IOException
public void addTablePermission(java.lang.String tableName,
java.lang.String userId,
java.lang.String readWrite)
throws java.io.IOException
addTablePermission in interface TableManagerProtocoljava.io.IOException
public void removeTablePermission(java.lang.String tableName,
java.lang.String userId)
throws java.io.IOException
removeTablePermission in interface TableManagerProtocoljava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||