getManager().copyQuotaSnapshots(); LOG.trace("Enabling " + newSnapshot + " on " + tableName); getManager().enforceViolationPolicy(tableName, newSnapshot); LOG.trace("Removing quota violation policy on " + tableName); getManager().disableViolationPolicyEnforcement(tableName); LOG.trace("Removing quota violation policy on " + tableName); getManager().disableViolationPolicyEnforcement(tableName); getManager().updateQuotaSnapshot(newSnapshots); } catch (IOException e) { LOG.warn(
@SuppressWarnings("unchecked") @Before public void setup() throws IOException { conf = HBaseConfiguration.create(); rss = mock(RegionServerServices.class); manager = mock(RegionServerSpaceQuotaManager.class); conn = mock(Connection.class); when(manager.getRegionServerServices()).thenReturn(rss); when(rss.getConfiguration()).thenReturn(conf); chore = mock(SpaceQuotaRefresherChore.class); when(chore.getConnection()).thenReturn(conn); when(chore.getManager()).thenReturn(manager); doCallRealMethod().when(chore).chore(); when(chore.isInViolation(any())).thenCallRealMethod(); doCallRealMethod().when(chore).extractQuotaSnapshot(any(), any()); }
@SuppressWarnings("unchecked") @Before public void setup() throws IOException { conf = HBaseConfiguration.create(); rss = mock(RegionServerServices.class); manager = mock(RegionServerSpaceQuotaManager.class); conn = mock(Connection.class); when(manager.getRegionServerServices()).thenReturn(rss); when(rss.getConfiguration()).thenReturn(conf); chore = mock(SpaceQuotaRefresherChore.class); when(chore.getConnection()).thenReturn(conn); when(chore.getManager()).thenReturn(manager); doCallRealMethod().when(chore).chore(); when(chore.isInViolation(any())).thenCallRealMethod(); doCallRealMethod().when(chore).extractQuotaSnapshot(any(), any()); }