Uploaded image for project: 'Sentry (Retired)'
  1. Sentry (Retired)
  2. SENTRY-2302 Optimize HDFS ACL Synchronization.
  3. SENTRY-2430

Avoid getting the complete partition objects and fetch the location information only.

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Sentry
    • Labels:
      None

      Description

      With the changes added as part of HIVE-20306, HiveMetaStoreClient now exposes new API "

      "getPartitionsWithSpecs" using which sentry can request specific information for partition.

      In simple words sentry could say fetch me the location information for the partitions in given table. Here is simple example on how it can be used.

       

       

       

       

          GetPartitionsRequest request = new GetPartitionsRequest();
      
          GetPartitionsProjectSpec projectSpec = new GetPartitionsProjectSpec();
      
          projectSpec.setFieldList(Arrays.asList("sd.location"));
      
          GetPartitionsFilterSpec filter = new GetPartitionsFilterSpec();
      
          filter.setDbName("compdb");
      
          filter.setTblName("comptbl");
      
          request.setFilterSpec(filter);
      
          request.setProjectionSpec(projectSpec);
      
          GetPartitionsResponse response;
      
          try {
      
            response = client.getPartitionsWithSpecs(request);
      
          } catch (Exception ex) {
      
            ex.printStackTrace();
      
            LOG.error("Exception while retrieving partitions", ex);
      
            throw ex;
      
          }
      

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kkalyan Krishna Kalyan
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: