Class PulsarConnectorUtils

java.lang.Object
org.apache.pulsar.sql.presto.PulsarConnectorUtils

public class PulsarConnectorUtils extends Object
A helper class containing repeatable logic used in the other classes.
  • Constructor Details

    • PulsarConnectorUtils

      public PulsarConnectorUtils()
  • Method Details

    • parseSchema

      public static org.apache.avro.Schema parseSchema(String schemaJson)
    • isPartitionedTopic

      public static boolean isPartitionedTopic(org.apache.pulsar.common.naming.TopicName topicName, org.apache.pulsar.client.admin.PulsarAdmin pulsarAdmin) throws org.apache.pulsar.client.admin.PulsarAdminException
      Throws:
      org.apache.pulsar.client.admin.PulsarAdminException
    • createInstance

      public static <T> T createInstance(String userClassName, Class<T> xface, ClassLoader classLoader)
      Create an instance of userClassName using provided classLoader. This instance should implement the provided interface xface.
      Parameters:
      userClassName - user class name
      xface - the interface that the reflected instance should implement
      classLoader - class loader to load the class.
      Returns:
      the instance
    • getProperties

      public static Properties getProperties(Map<String,String> configMap)
    • rewriteNamespaceDelimiterIfNeeded

      public static String rewriteNamespaceDelimiterIfNeeded(String namespace, PulsarConnectorConfig config)
    • restoreNamespaceDelimiterIfNeeded

      public static String restoreNamespaceDelimiterIfNeeded(String namespace, PulsarConnectorConfig config)