@Test public void testRequestSyncUpdatesWhenNoUpdatesExistReturnsEmptyResults() throws Exception { Mockito.when(sentryStoreMock.getLastProcessedImageID()) .thenReturn(1L); Mockito.when(sentryStoreMock.getLastProcessedPathChangeID()) .thenReturn(2L); Mockito.when(sentryStoreMock.getLastProcessedPermChangeID()) .thenReturn(2L); TAuthzUpdateRequest updateRequest = new TAuthzUpdateRequest(3, 3, 1); TAuthzUpdateResponse sentryUpdates= serviceProcessor.get_authz_updates(updateRequest); assertEquals(0, sentryUpdates.getAuthzPathUpdateSize()); assertEquals(0, sentryUpdates.getAuthzPermUpdateSize()); }
@Override public TAuthzUpdateResponse get_authz_updates(TAuthzUpdateRequest request) throws TException { TAuthzUpdateResponse retVal = new TAuthzUpdateResponse(); if (SentryPlugin.instance == null) { LOGGER.error("SentryPlugin not initialized yet !!"); retVal.setAuthzPathUpdate(Collections.<TPathsUpdate>emptyList()); retVal.setAuthzPermUpdate(Collections.<TPermissionsUpdate>emptyList()); return retVal; } try (Context timerContext = SentryHdfsMetricsUtil.getAllAuthzUpdatesTimer.time()) { retVal.setAuthzPermUpdate(getPermissionsUpdatesFrom(request)); retVal.setAuthzPathUpdate(getPathsUpdatesFrom(request)); } catch (Exception e) { LOGGER.error("Error Sending updates to downstream Cache", e); throw new TException(e); } return retVal; }
SentryHDFSServiceProcessor implements SentryHDFSService.Iface { @Override public TAuthzUpdateResponse get_authz_updates(TAuthzUpdateRequest request) throws TException { TAuthzUpdateResponse retVal = new TAuthzUpdateResponse(); if (SentryPlugin.instance == null) { LOGGER.error("SentryPlugin not initialized yet !!"); retVal.setAuthzPathUpdate(Collections.<TPathsUpdate>emptyList()); retVal.setAuthzPermUpdate(Collections.<TPermissionsUpdate>emptyList()); return retVal; } try (Context timerContext = SentryHdfsMetricsUtil.getAllAuthzUpdatesTimer.time()) { retVal.setAuthzPermUpdate(getPermissionsUpdatesFrom(request)); retVal.setAuthzPathUpdate(getPathsUpdatesFrom(request)); } catch (Exception e) { LOGGER.error("Error Sending updates to downstream Cache", e); throw new TException(e); } return retVal; } }
SentryHDFSServiceProcessor implements SentryHDFSService.Iface { @Override public TAuthzUpdateResponse get_authz_updates(TAuthzUpdateRequest request) throws TException { TAuthzUpdateResponse retVal = new TAuthzUpdateResponse(); if (SentryPlugin.instance == null) { LOGGER.error("SentryPlugin not initialized yet !!"); retVal.setAuthzPathUpdate(Collections.<TPathsUpdate>emptyList()); retVal.setAuthzPermUpdate(Collections.<TPermissionsUpdate>emptyList()); return retVal; } try (Context timerContext = SentryHdfsMetricsUtil.getAllAuthzUpdatesTimer.time()) { retVal.setAuthzPermUpdate(getPermissionsUpdatesFrom(request)); retVal.setAuthzPathUpdate(getPathsUpdatesFrom(request)); } catch (Exception e) { LOGGER.error("Error Sending updates to downstream Cache", e); throw new TException(e); } return retVal; }  }
SentryHDFSServiceProcessor implements SentryHDFSService.Iface { @Override public TAuthzUpdateResponse get_authz_updates(TAuthzUpdateRequest request) throws TException { TAuthzUpdateResponse retVal = new TAuthzUpdateResponse(); if (SentryPlugin.instance == null) { LOGGER.error("SentryPlugin not initialized yet !!"); retVal.setAuthzPathUpdate(Collections.<TPathsUpdate>emptyList()); retVal.setAuthzPermUpdate(Collections.<TPermissionsUpdate>emptyList()); return retVal; } try (Context timerContext = SentryHdfsMetricsUtil.getAllAuthzUpdatesTimer.time()) { retVal.setAuthzPermUpdate(getPermissionsUpdatesFrom(request)); retVal.setAuthzPathUpdate(getPathsUpdatesFrom(request)); } catch (Exception e) { LOGGER.error("Error Sending updates to downstream Cache", e); throw new TException(e); } return retVal; }  @Override TAuthzUpdateResponse get_all_authz_updates_from(long permSeqNum, long pathSeqNum); @Override TAuthzUpdateResponse get_authz_updates(TAuthzUpdateRequest request); @Override void handle_hms_notification(TPathsUpdate update); @Override long check_hms_seq_num(long pathSeqNum); @Override Map<String, List<String>> get_all_related_paths(String arg0,
      boolean arg1); }
SentryHDFSServiceProcessor implements SentryHDFSService.Iface { @Override public TAuthzUpdateResponse get_authz_updates(TAuthzUpdateRequest request) throws TException { TAuthzUpdateResponse retVal = new TAuthzUpdateResponse(); if (SentryPlugin.instance == null) { LOGGER.error("SentryPlugin not initialized yet !!"); retVal.setAuthzPathUpdate(Collections.<TPathsUpdate>emptyList()); retVal.setAuthzPermUpdate(Collections.<TPermissionsUpdate>emptyList()); return retVal; } try (Context timerContext = SentryHdfsMetricsUtil.getAllAuthzUpdatesTimer.time()) { retVal.setAuthzPermUpdate(getPermissionsUpdatesFrom(request)); retVal.setAuthzPathUpdate(getPathsUpdatesFrom(request)); } catch (Exception e) { LOGGER.error("Error Sending updates to downstream Cache", e); throw new TException(e); } return retVal; }  @Override TAuthzUpdateResponse get_all_authz_updates_from(long permSeqNum, long pathSeqNum); @Override TAuthzUpdateResponse get_authz_updates(TAuthzUpdateRequest request); @Override void handle_hms_notification(TPathsUpdate update); @Override long check_hms_seq_num(long pathSeqNum); @Override Map<String, List<String>> get_all_related_paths(String arg0,
      boolean arg1);  }