Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-5180

Add API to PhoenixRunTime to get ptable of a tenant using a global connection

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.15.0, 5.1.0
    • Component/s: None
    • Labels:

      Description

      If we want to look up the PTable of a tenant view we currently need to create a tenant specific connection and call PhoenixRuntime.getTable(). This could be inefficient if we need to create millions of tenant specific connections.

      We could instead just pass in the tenant id and use a global connection
      getTable(Connection conn, String tenantId, String fullTableName, long timestamp)

      Insread of using the scn from the connection to set the clientTimestamp, we would use the passed in timestamp.

      If the table isn't cached we would need to make a rpc to fetch the table from SYSTEM.CATALOG

      MetaDataMutationResult result = new MetaDataClient(pconn).updateCache(PName tenantId, String schemaName, String tableName)
      

      FYI Andrew Purtell

        Attachments

        1. PHOENIX-5180-master.patch
          15 kB
          Abhishek Singh Chouhan

          Activity

            People

            • Assignee:
              abhishek.chouhan Abhishek Singh Chouhan
              Reporter:
              tdsilva Thomas D'Silva
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: