@InterfaceAudience.Private public class MetaEditor extends Object
hbase:meta.
TODO: Put MetaReader and MetaEditor together; doesn't make sense having
them distinct. see HBASE-3475.| Constructor and Description |
|---|
MetaEditor() |
| Modifier and Type | Method and Description |
|---|---|
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 |
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 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 |
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 updateSeqNum)
Updates the location of the specified region in hbase:meta to be the specified
server hostname and startcode.
|
public static Put makePutFromRegionInfo(HRegionInfo regionInfo) throws IOException
IOExceptionpublic static Delete makeDeleteFromRegionInfo(HRegionInfo regionInfo)
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:metaIOExceptionpublic 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.IOExceptionpublic 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:metaIOExceptionpublic static void addRegionToMeta(CatalogTracker catalogTracker, HRegionInfo regionInfo) throws IOException
regionInfo - region informationIOException - if problem connecting or updating metapublic static void addRegionToMeta(HTable meta, HRegionInfo regionInfo) throws IOException
meta - the HTable for METAregionInfo - region informationIOException - 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 regionInfoIOException - 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 regionInfoIOException - if problem connecting or updating metapublic static void addRegionsToMeta(CatalogTracker catalogTracker, List<HRegionInfo> regionInfos) throws IOException
catalogTracker - CatalogTrackerregionInfos - region information listIOException - 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 openNotAllMetaRegionsOnlineExceptionIOExceptionpublic 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 regionIOExceptionpublic 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 regionIOExceptionpublic 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 openIOExceptionConnectException - 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 updateSeqNum) 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 nameIOExceptionpublic static void deleteRegion(CatalogTracker catalogTracker, HRegionInfo regionInfo) throws IOException
catalogTracker - regionInfo - region to be deleted from METAIOExceptionpublic static void deleteRegions(CatalogTracker catalogTracker, List<HRegionInfo> regionsInfo) throws IOException
catalogTracker - regionsInfo - list of regions to be deleted from METAIOExceptionpublic 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 METAIOExceptionpublic static void overwriteRegions(CatalogTracker catalogTracker, List<HRegionInfo> regionInfos) throws IOException
catalogTracker - regionInfos - list of regions to be added to METAIOExceptionpublic static void deleteMergeQualifiers(CatalogTracker catalogTracker, HRegionInfo mergedRegion) throws IOException
catalogTracker - mergedRegion - IOExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.