/** * Deletes the specified regions from META. * @param connection connection we're using * @param regionsInfo list of regions to be deleted from META */ public static void deleteRegions(Connection connection, List<RegionInfo> regionsInfo) throws IOException { deleteRegions(connection, regionsInfo, EnvironmentEdgeManager.currentTime()); } /**
public void deleteRegions(final List<RegionInfo> regions) throws IOException { MetaTableAccessor.deleteRegions(master.getConnection(), regions); }
/** * Overwrites the specified regions from hbase:meta. Deletes old rows for the given regions and * adds new ones. Regions added back have state CLOSED. * @param connection connection we're using * @param regionInfos list of regions to be added to META */ public static void overwriteRegions(Connection connection, List<RegionInfo> regionInfos, int regionReplication) throws IOException { // use master time for delete marker and the Put long now = EnvironmentEdgeManager.currentTime(); deleteRegions(connection, regionInfos, now); // Why sleep? This is the easiest way to ensure that the previous deletes does not // eclipse the following puts, that might happen in the same ts from the server. // See HBASE-9906, and HBASE-9879. Once either HBASE-9879, HBASE-8770 is fixed, // or HBASE-9905 is fixed and meta uses seqIds, we do not need the sleep. // // HBASE-13875 uses master timestamp for the mutations. The 20ms sleep is not needed addRegionsToMeta(connection, regionInfos, regionReplication, now + 1); LOG.info("Overwritten " + regionInfos.size() + " regions to Meta"); LOG.debug("Overwritten regions: {} ", regionInfos); }
protected static void deleteFromMeta(final MasterProcedureEnv env, final TableName tableName, List<RegionInfo> regions) throws IOException { MetaTableAccessor.deleteRegions(env.getMasterServices().getConnection(), regions); // Clean any remaining rows for this table. cleanAnyRemainingRows(env, tableName); // clean region references from the server manager env.getMasterServices().getServerManager().removeRegions(regions); // Clear Favored Nodes for this table FavoredNodesManager fnm = env.getMasterServices().getFavoredNodesManager(); if (fnm != null) { fnm.deleteFavoredNodesForRegions(regions); } }
MetaTableAccessor.deleteRegions(conn, regionsToRemove); deleteRegionsFromInMemoryStates(regionsToRemove, env, regionReplication);
/** * Deletes the specified regions from META. * @param connection connection we're using * @param regionsInfo list of regions to be deleted from META */ public static void deleteRegions(Connection connection, List<RegionInfo> regionsInfo) throws IOException { deleteRegions(connection, regionsInfo, EnvironmentEdgeManager.currentTime()); } /**
/** * Overwrites the specified regions from hbase:meta. Deletes old rows for the given regions and * adds new ones. Regions added back have state CLOSED. * @param connection connection we're using * @param regionInfos list of regions to be added to META */ public static void overwriteRegions(Connection connection, List<RegionInfo> regionInfos, int regionReplication) throws IOException { // use master time for delete marker and the Put long now = EnvironmentEdgeManager.currentTime(); deleteRegions(connection, regionInfos, now); // Why sleep? This is the easiest way to ensure that the previous deletes does not // eclipse the following puts, that might happen in the same ts from the server. // See HBASE-9906, and HBASE-9879. Once either HBASE-9879, HBASE-8770 is fixed, // or HBASE-9905 is fixed and meta uses seqIds, we do not need the sleep. // // HBASE-13875 uses master timestamp for the mutations. The 20ms sleep is not needed addRegionsToMeta(connection, regionInfos, regionReplication, now + 1); LOG.info("Overwritten " + regionInfos.size() + " regions to Meta"); LOG.debug("Overwritten regions: {} ", regionInfos); }
/** * Deletes the specified regions from META. * @param connection connection we're using * @param regionsInfo list of regions to be deleted from META * @throws IOException */ public static void deleteRegions(Connection connection, List<HRegionInfo> regionsInfo) throws IOException { deleteRegions(connection, regionsInfo, HConstants.LATEST_TIMESTAMP); }
/** * Deletes the specified regions from META. * @param connection connection we're using * @param regionsInfo list of regions to be deleted from META */ public static void deleteRegions(Connection connection, List<RegionInfo> regionsInfo) throws IOException { deleteRegions(connection, regionsInfo, EnvironmentEdgeManager.currentTime()); } /**
/** * Overwrites the specified regions from hbase:meta. Deletes old rows for the given regions and * adds new ones. Regions added back have state CLOSED. * @param connection connection we're using * @param regionInfos list of regions to be added to META */ public static void overwriteRegions(Connection connection, List<RegionInfo> regionInfos, int regionReplication) throws IOException { // use master time for delete marker and the Put long now = EnvironmentEdgeManager.currentTime(); deleteRegions(connection, regionInfos, now); // Why sleep? This is the easiest way to ensure that the previous deletes does not // eclipse the following puts, that might happen in the same ts from the server. // See HBASE-9906, and HBASE-9879. Once either HBASE-9879, HBASE-8770 is fixed, // or HBASE-9905 is fixed and meta uses seqIds, we do not need the sleep. // // HBASE-13875 uses master timestamp for the mutations. The 20ms sleep is not needed addRegionsToMeta(connection, regionInfos, regionReplication, now + 1); LOG.info("Overwritten " + regionInfos.size() + " regions to Meta"); LOG.debug("Overwritten regions: {} ", regionInfos); }
protected static void deleteFromMeta(final MasterProcedureEnv env, final TableName tableName, List<HRegionInfo> regions) throws IOException { MetaTableAccessor.deleteRegions(env.getMasterServices().getConnection(), regions); // Clean any remaining rows for this table. cleanAnyRemainingRows(env, tableName); }
/** * Overwrites the specified regions from hbase:meta * @param connection connection we're using * @param regionInfos list of regions to be added to META * @throws IOException */ public static void overwriteRegions(Connection connection, List<HRegionInfo> regionInfos, int regionReplication) throws IOException { // use master time for delete marker and the Put long now = EnvironmentEdgeManager.currentTime(); deleteRegions(connection, regionInfos, now); // Why sleep? This is the easiest way to ensure that the previous deletes does not // eclipse the following puts, that might happen in the same ts from the server. // See HBASE-9906, and HBASE-9879. Once either HBASE-9879, HBASE-8770 is fixed, // or HBASE-9905 is fixed and meta uses seqIds, we do not need the sleep. // // HBASE-13875 uses master timestamp for the mutations. The 20ms sleep is not needed addRegionsToMeta(connection, regionInfos, regionReplication, now+1); LOG.info("Overwritten " + regionInfos); }
MetaTableAccessor.deleteRegions(conn, hrisToRemove);