|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.catalog.MetaEditor
@InterfaceAudience.Private public class MetaEditor
Writes region and assignment information to hbase:meta
.
TODO: Put MetaReader and MetaEditor together; doesn't make sense having
them distinct. see HBASE-3475.
Constructor Summary | |
---|---|
MetaEditor()
|
Method Summary | |
---|---|
static void |
addDaughter(CatalogTracker catalogTracker,
HRegionInfo regionInfo,
ServerName sn,
long openSeqNum)
Adds a daughter region entry to meta. |
static Put |
addDaughtersToPut(Put put,
HRegionInfo splitA,
HRegionInfo splitB)
Adds split daughters to the Put |
static void |
addRegionsToMeta(CatalogTracker catalogTracker,
List<HRegionInfo> regionInfos)
Adds a hbase:meta row for each of the specified new regions. |
static void |
addRegionsToMeta(CatalogTracker catalogTracker,
List<HRegionInfo> regionInfos,
long ts)
Adds a hbase:meta row for each of the specified new regions. |
static void |
addRegionToMeta(CatalogTracker catalogTracker,
HRegionInfo regionInfo)
Adds a hbase:meta row for the specified new region. |
static void |
addRegionToMeta(CatalogTracker catalogTracker,
HRegionInfo regionInfo,
HRegionInfo splitA,
HRegionInfo splitB)
Adds a (single) hbase:meta row for the specified new region and its daughters. |
static void |
addRegionToMeta(HTable meta,
HRegionInfo regionInfo)
Adds a hbase:meta row for the specified new region to the given catalog table. |
static void |
addRegionToMeta(HTable meta,
HRegionInfo regionInfo,
HRegionInfo splitA,
HRegionInfo splitB)
Adds a (single) hbase:meta row for the specified new region and its daughters. |
static void |
deleteFromMetaTable(CatalogTracker ct,
List<Delete> deletes)
Delete the passed deletes from the hbase:meta table. |
static void |
deleteMergeQualifiers(CatalogTracker catalogTracker,
HRegionInfo mergedRegion)
Deletes merge qualifiers for the specified merged region. |
static void |
deleteRegion(CatalogTracker catalogTracker,
HRegionInfo regionInfo)
Deletes the specified region from META. |
static void |
deleteRegions(CatalogTracker catalogTracker,
List<HRegionInfo> regionsInfo)
Deletes the specified regions from META. |
static void |
deleteRegions(CatalogTracker catalogTracker,
List<HRegionInfo> regionsInfo,
long ts)
Deletes the specified regions from META. |
static Delete |
makeDeleteFromRegionInfo(HRegionInfo regionInfo)
Generates and returns a Delete containing the region info for the catalog table |
static Delete |
makeDeleteFromRegionInfo(HRegionInfo regionInfo,
long ts)
Generates and returns a Delete containing the region info for the catalog table |
static Put |
makePutFromRegionInfo(HRegionInfo regionInfo)
Generates and returns a Put containing the region into for the catalog table |
static Put |
makePutFromRegionInfo(HRegionInfo regionInfo,
long ts)
Generates and returns a Put containing the region into for the catalog table |
static void |
mergeRegions(CatalogTracker catalogTracker,
HRegionInfo mergedRegion,
HRegionInfo regionA,
HRegionInfo regionB,
ServerName sn,
long masterSystemTime)
Merge the two regions into one in an atomic operation. |
static void |
mutateMetaTable(CatalogTracker ct,
List<Mutation> mutations)
Execute the passed mutations against hbase:meta table. |
static void |
mutateRegions(CatalogTracker catalogTracker,
List<HRegionInfo> regionsToRemove,
List<HRegionInfo> regionsToAdd)
Adds and Removes the specified regions from hbase:meta |
static void |
overwriteRegions(CatalogTracker catalogTracker,
List<HRegionInfo> regionInfos)
Overwrites the specified regions from hbase:meta |
static void |
putsToMetaTable(CatalogTracker ct,
List<Put> ps)
Put the passed ps to the hbase:meta table. |
static void |
splitRegion(CatalogTracker catalogTracker,
HRegionInfo parent,
HRegionInfo splitA,
HRegionInfo splitB,
ServerName sn)
Splits the region into two in an atomic operation. |
static void |
updateMetaLocation(CatalogTracker catalogTracker,
HRegionInfo regionInfo,
ServerName sn,
long openSeqNum)
Updates the location of the specified hbase:meta region in ROOT to be the specified server hostname and startcode. |
static void |
updateRegionLocation(CatalogTracker catalogTracker,
HRegionInfo regionInfo,
ServerName sn,
long openSeqNum)
Updates the location of the specified region in hbase:meta to be the specified server hostname and startcode. |
static void |
updateRegionLocation(CatalogTracker catalogTracker,
HRegionInfo regionInfo,
ServerName sn,
long openSeqNum,
long masterSystemTime)
Updates the location of the specified region in hbase:meta to be the specified server hostname and startcode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetaEditor()
Method Detail |
---|
public static Put makePutFromRegionInfo(HRegionInfo regionInfo) throws IOException
IOException
public static Put makePutFromRegionInfo(HRegionInfo regionInfo, long ts) throws IOException
IOException
public static Delete makeDeleteFromRegionInfo(HRegionInfo regionInfo)
public static Delete makeDeleteFromRegionInfo(HRegionInfo regionInfo, long ts)
public static Put addDaughtersToPut(Put put, HRegionInfo splitA, HRegionInfo splitB)
public static void putsToMetaTable(CatalogTracker ct, List<Put> ps) throws IOException
ps
to the hbase:meta
table.
ct
- CatalogTracker on whose back we will ride the edit.ps
- Put to add to hbase:meta
IOException
public static void deleteFromMetaTable(CatalogTracker ct, List<Delete> deletes) throws IOException
deletes
from the hbase:meta
table.
ct
- CatalogTracker on whose back we will ride the edit.deletes
- Deletes to add to hbase:meta This list should support #remove.
IOException
public static void mutateMetaTable(CatalogTracker ct, List<Mutation> mutations) throws IOException
mutations
against hbase:meta
table.
ct
- CatalogTracker on whose back we will ride the edit.mutations
- Puts and Deletes to execute on hbase:meta
IOException
public static void addRegionToMeta(CatalogTracker catalogTracker, HRegionInfo regionInfo) throws IOException
regionInfo
- region information
IOException
- if problem connecting or updating metapublic static void addRegionToMeta(HTable meta, HRegionInfo regionInfo) throws IOException
meta
- the HTable for METAregionInfo
- region information
IOException
- if problem connecting or updating metapublic static void addRegionToMeta(HTable meta, HRegionInfo regionInfo, HRegionInfo splitA, HRegionInfo splitB) throws IOException
splitRegion(CatalogTracker, HRegionInfo, HRegionInfo, HRegionInfo, ServerName)
if you want to do that.
meta
- the HTable for METAregionInfo
- region informationsplitA
- first split daughter of the parent regionInfosplitB
- second split daughter of the parent regionInfo
IOException
- if problem connecting or updating metapublic static void addRegionToMeta(CatalogTracker catalogTracker, HRegionInfo regionInfo, HRegionInfo splitA, HRegionInfo splitB) throws IOException
splitRegion(CatalogTracker, HRegionInfo, HRegionInfo, HRegionInfo, ServerName)
if you want to do that.
catalogTracker
- CatalogTracker on whose back we will ride the edit.regionInfo
- region informationsplitA
- first split daughter of the parent regionInfosplitB
- second split daughter of the parent regionInfo
IOException
- if problem connecting or updating metapublic static void addRegionsToMeta(CatalogTracker catalogTracker, List<HRegionInfo> regionInfos) throws IOException
catalogTracker
- CatalogTrackerregionInfos
- region information list
IOException
- if problem connecting or updating metapublic static void addRegionsToMeta(CatalogTracker catalogTracker, List<HRegionInfo> regionInfos, long ts) throws IOException
catalogTracker
- CatalogTrackerregionInfos
- region information listts
- desired timestamp
IOException
- if problem connecting or updating metapublic static void addDaughter(CatalogTracker catalogTracker, HRegionInfo regionInfo, ServerName sn, long openSeqNum) throws NotAllMetaRegionsOnlineException, IOException
regionInfo
- the region to putsn
- the location of the regionopenSeqNum
- the latest sequence number obtained when the region was open
NotAllMetaRegionsOnlineException
IOException
public static void mergeRegions(CatalogTracker catalogTracker, HRegionInfo mergedRegion, HRegionInfo regionA, HRegionInfo regionB, ServerName sn, long masterSystemTime) throws IOException
catalogTracker
- the catalog trackermergedRegion
- the merged regionregionA
- regionB
- sn
- the location of the regionmasterSystemTime
- wall clock time from master if passed in the open region RPC or -1
IOException
public static void splitRegion(CatalogTracker catalogTracker, HRegionInfo parent, HRegionInfo splitA, HRegionInfo splitB, ServerName sn) throws IOException
catalogTracker
- the catalog trackerparent
- the parent region which is splitsplitA
- Split daughter region AsplitB
- Split daughter region Asn
- the location of the region
IOException
public static void updateMetaLocation(CatalogTracker catalogTracker, HRegionInfo regionInfo, ServerName sn, long openSeqNum) throws IOException, ConnectException
Uses passed catalog tracker to get a connection to the server hosting ROOT and makes edits to that region.
catalogTracker
- catalog trackerregionInfo
- region to update location ofsn
- Server nameopenSeqNum
- the latest sequence number obtained when the region was open
IOException
ConnectException
- Usually because the regionserver carrying hbase:meta
is down.
NullPointerException
- Because no -ROOT- server connectionpublic static void updateRegionLocation(CatalogTracker catalogTracker, HRegionInfo regionInfo, ServerName sn, long openSeqNum) throws IOException
Uses passed catalog tracker to get a connection to the server hosting hbase:meta and makes edits to that region.
catalogTracker
- catalog trackerregionInfo
- region to update location ofsn
- Server nameopenSeqNum
- the latest sequence number obtained when the region was open
IOException
public static void updateRegionLocation(CatalogTracker catalogTracker, HRegionInfo regionInfo, ServerName sn, long openSeqNum, long masterSystemTime) throws IOException
Uses passed catalog tracker to get a connection to the server hosting hbase:meta and makes edits to that region.
catalogTracker
- catalog trackerregionInfo
- region to update location ofsn
- Server nameopenSeqNum
- the latest sequence number obtained when the region was openmasterSystemTime
- wall clock time from master if passed in the open region RPC or -1
IOException
public static void deleteRegion(CatalogTracker catalogTracker, HRegionInfo regionInfo) throws IOException
catalogTracker
- regionInfo
- region to be deleted from META
IOException
public static void deleteRegions(CatalogTracker catalogTracker, List<HRegionInfo> regionsInfo) throws IOException
catalogTracker
- regionsInfo
- list of regions to be deleted from META
IOException
public static void deleteRegions(CatalogTracker catalogTracker, List<HRegionInfo> regionsInfo, long ts) throws IOException
catalogTracker
- regionsInfo
- list of regions to be deleted from METAts
- desired timestamp
IOException
public static void mutateRegions(CatalogTracker catalogTracker, List<HRegionInfo> regionsToRemove, List<HRegionInfo> regionsToAdd) throws IOException
catalogTracker
- regionsToRemove
- list of regions to be deleted from METAregionsToAdd
- list of regions to be added to META
IOException
public static void overwriteRegions(CatalogTracker catalogTracker, List<HRegionInfo> regionInfos) throws IOException
catalogTracker
- regionInfos
- list of regions to be added to META
IOException
public static void deleteMergeQualifiers(CatalogTracker catalogTracker, HRegionInfo mergedRegion) throws IOException
catalogTracker
- mergedRegion
-
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |