示例#1
0
 @Override
 public void registerForNotification(URI uri, Configuration conf, String user, String actionID)
     throws URIHandlerException {
   HCatURI hcatURI;
   try {
     hcatURI = new HCatURI(uri);
   } catch (URISyntaxException e) {
     throw new URIHandlerException(ErrorCode.E0906, uri, e);
   }
   HCatAccessorService hcatService = Services.get().get(HCatAccessorService.class);
   if (!hcatService.isRegisteredForNotification(hcatURI)) {
     HCatClient client = getHCatClient(uri, conf, user);
     try {
       String topic = client.getMessageBusTopicName(hcatURI.getDb(), hcatURI.getTable());
       if (topic == null) {
         return;
       }
       hcatService.registerForNotification(
           hcatURI, topic, new HCatMessageHandler(uri.getAuthority()));
     } catch (HCatException e) {
       throw new HCatAccessorException(ErrorCode.E1501, e);
     } finally {
       closeQuietly(client, true);
     }
   }
   PartitionDependencyManagerService pdmService =
       Services.get().get(PartitionDependencyManagerService.class);
   pdmService.addMissingDependency(hcatURI, actionID);
 }
示例#2
0
 @Override
 public DependencyType getDependencyType(URI uri) throws URIHandlerException {
   DependencyType depType = DependencyType.PULL;
   // Not initializing in constructor as this will be part of oozie.services.ext
   // and will be initialized after URIHandlerService
   HCatAccessorService hcatService = Services.get().get(HCatAccessorService.class);
   if (hcatService != null) {
     depType = dependencyTypes.get(uri.getAuthority());
     if (depType == null) {
       depType = hcatService.isKnownPublisher(uri) ? DependencyType.PUSH : DependencyType.PULL;
       dependencyTypes.put(uri.getAuthority(), depType);
     }
   }
   return depType;
 }