Exemple #1
0
 private Collection<EntityIndexConfig> getPartitionIndexConfigs(final EntityConfig config) {
   return Filter.grep(
       new Predicate<EntityIndexConfig>() {
         public boolean f(EntityIndexConfig entityIndexConfig) {
           return entityIndexConfig.getIndexType().equals(IndexType.Partition);
         }
       },
       config.getEntityIndexConfigs());
 }
Exemple #2
0
 private void conditionallyInsertDelegatedResourceIndexes(EntityConfig config, Object entity)
     throws HiveLockableException {
   for (EntityIndexConfig entityIndexConfig : config.getEntityIndexConfigs())
     if (entityIndexConfig.getIndexType().equals(IndexType.Delegates)) {
       final EntityIndexConfigDelegator delegateEntityConfig =
           ((EntityIndexConfigDelegator) entityIndexConfig);
       for (Object value : entityIndexConfig.getIndexValues(entity))
         if (!hive.directory()
             .doesResourceIdExist(
                 delegateEntityConfig.getDelegateEntityConfig().getResourceName(), value))
           insert(
               delegateEntityConfig.getDelegateEntityConfig(),
               delegateEntityConfig.stubEntityInstance(value, config.getPrimaryIndexKey(entity)));
     }
 }