public class MetaEditor extends Object
.META.
.
TODO: Put MetaReader and MetaEditor together; doesn't make sense having
them distinct.Constructor and Description |
---|
MetaEditor() |
Modifier and Type | Method and Description |
---|---|
static void |
addDaughter(CatalogTracker catalogTracker,
HRegionInfo regionInfo,
ServerName sn) |
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 |
deleteFromMetaTable(CatalogTracker ct,
List<Delete> deletes)
Delete the passed
deletes from the .META. table. |
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 PairOfSameType<HRegionInfo> |
getDaughterRegions(Result data)
Returns the daughter regions by reading from the corresponding columns of the .META.
|
static HRegionInfo |
getHRegionInfo(Result data) |
static void |
mutateRegions(CatalogTracker catalogTracker,
List<HRegionInfo> regionsToRemove,
List<HRegionInfo> regionsToAdd)
Adds and Removes the specified regions from .META.
|
static void |
offlineParentInMeta(CatalogTracker catalogTracker,
HRegionInfo parent,
HRegionInfo a,
HRegionInfo b)
Offline parent in meta.
|
static void |
overwriteRegions(CatalogTracker catalogTracker,
List<HRegionInfo> regionInfos)
Overwrites the specified regions from hbase:meta
|
static void |
updateMetaLocation(CatalogTracker catalogTracker,
HRegionInfo regionInfo,
ServerName sn)
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)
Updates the location of the specified region in META to be the specified
server hostname and startcode.
|
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 informationIOException
- 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 offlineParentInMeta(CatalogTracker catalogTracker, HRegionInfo parent, HRegionInfo a, HRegionInfo b) throws NotAllMetaRegionsOnlineException, IOException
catalogTracker
- parent
- a
- Split daughter region Ab
- Split daughter region BNotAllMetaRegionsOnlineException
IOException
public static void addDaughter(CatalogTracker catalogTracker, HRegionInfo regionInfo, ServerName sn) throws NotAllMetaRegionsOnlineException, IOException
public static void updateMetaLocation(CatalogTracker catalogTracker, HRegionInfo regionInfo, ServerName sn) 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 nameIOException
ConnectException
- Usually because the regionserver carrying .META.
is down.NullPointerException
- Because no -ROOT- server connectionpublic static void updateRegionLocation(CatalogTracker catalogTracker, HRegionInfo regionInfo, ServerName sn) 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 nameIOException
public static void deleteRegion(CatalogTracker catalogTracker, HRegionInfo regionInfo) throws IOException
catalogTracker
- regionInfo
- region to be deleted from METAIOException
public static void deleteRegions(CatalogTracker catalogTracker, List<HRegionInfo> regionsInfo) throws IOException
catalogTracker
- regionsInfo
- list of regions to be deleted from METAIOException
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 METAIOException
public static void overwriteRegions(CatalogTracker catalogTracker, List<HRegionInfo> regionInfos) throws IOException
catalogTracker
- regionInfos
- list of regions to be added to METAIOException
public static HRegionInfo getHRegionInfo(Result data) throws IOException
IOException
public static PairOfSameType<HRegionInfo> getDaughterRegions(Result data) throws IOException
IOException
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.