Package org.apache.pulsar.sql.presto
Class PulsarConnectorUtils
java.lang.Object
org.apache.pulsar.sql.presto.PulsarConnectorUtils
A helper class containing repeatable logic used in the other classes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TcreateInstance(String userClassName, Class<T> xface, ClassLoader classLoader) Create an instance ofuserClassNameusing providedclassLoader.static PropertiesgetProperties(Map<String, String> configMap) static booleanisPartitionedTopic(org.apache.pulsar.common.naming.TopicName topicName, org.apache.pulsar.client.admin.PulsarAdmin pulsarAdmin) static org.apache.avro.SchemaparseSchema(String schemaJson) static StringrestoreNamespaceDelimiterIfNeeded(String namespace, PulsarConnectorConfig config) static StringrewriteNamespaceDelimiterIfNeeded(String namespace, PulsarConnectorConfig config)
-
Constructor Details
-
PulsarConnectorUtils
public PulsarConnectorUtils()
-
-
Method Details
-
parseSchema
-
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
Create an instance ofuserClassNameusing providedclassLoader. This instance should implement the provided interfacexface.- Parameters:
userClassName- user class namexface- the interface that the reflected instance should implementclassLoader- class loader to load the class.- Returns:
- the instance
-
getProperties
-
rewriteNamespaceDelimiterIfNeeded
public static String rewriteNamespaceDelimiterIfNeeded(String namespace, PulsarConnectorConfig config) -
restoreNamespaceDelimiterIfNeeded
public static String restoreNamespaceDelimiterIfNeeded(String namespace, PulsarConnectorConfig config)
-