|
||||||||||
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 .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 META row for each of the specified new regions. |
static void |
addRegionToMeta(CatalogTracker catalogTracker,
HRegionInfo regionInfo)
Adds a META row for the specified new region. |
static void |
addRegionToMeta(HTable meta,
HRegionInfo regionInfo)
Adds a 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) META row for the specified new region and its daughters. |
static void |
deleteDaughtersReferencesInParent(CatalogTracker catalogTracker,
HRegionInfo parent)
Deletes daughters references in offlined split parent. |
static void |
deleteFromMetaTable(CatalogTracker ct,
List<Delete> deletes)
Delete the passed deletes from the .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 Delete |
makeDeleteFromRegionInfo(HRegionInfo regionInfo)
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 void |
mergeRegions(CatalogTracker catalogTracker,
HRegionInfo mergedRegion,
HRegionInfo regionA,
HRegionInfo regionB,
ServerName sn)
Merge the two regions into one in an atomic operation. |
static void |
mutateRegions(CatalogTracker catalogTracker,
List<HRegionInfo> regionsToRemove,
List<HRegionInfo> regionsToAdd)
Adds and Removes the specified regions from .META. |
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 META region in ROOT to be the specified server hostname and startcode. |
static void |
updateRegionLocation(CatalogTracker catalogTracker,
HRegionInfo regionInfo,
ServerName sn,
long updateSeqNum)
Updates the location of the specified region in 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 Delete makeDeleteFromRegionInfo(HRegionInfo regionInfo)
public static Put addDaughtersToPut(Put put, HRegionInfo splitA, HRegionInfo splitB)
public static void deleteFromMetaTable(CatalogTracker ct, List<Delete> deletes) throws IOException
deletes
from the .META.
table.
ct
- CatalogTracker on whose back we will ride the edit.deletes
- Deletes to add to .META. This list should support #remove.
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 addRegionsToMeta(CatalogTracker catalogTracker, List<HRegionInfo> regionInfos) throws IOException
catalogTracker
- CatalogTrackerregionInfos
- region information list
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) throws IOException
catalogTracker
- the catalog trackermergedRegion
- the merged regionregionA
- regionB
- sn
- the location of the region
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 .META.
is down.
NullPointerException
- Because no -ROOT- server connectionpublic static void updateRegionLocation(CatalogTracker catalogTracker, HRegionInfo regionInfo, ServerName sn, long updateSeqNum) throws IOException
Uses passed catalog tracker to get a connection to the server hosting META and makes edits to that region.
catalogTracker
- catalog trackerregionInfo
- region to update location ofsn
- Server name
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 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 deleteDaughtersReferencesInParent(CatalogTracker catalogTracker, HRegionInfo parent) throws NotAllMetaRegionsOnlineException, IOException
catalogTracker
- parent
- Parent row we're to remove daughter reference from
NotAllMetaRegionsOnlineException
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 |