Java源码示例:org.apache.flink.table.descriptors.Descriptor
示例1
@Override
protected List<Descriptor> descriptors() {
HBase hbaseDesc0 = new HBase()
.version("1.4.3")
.tableName("testNs:table0")
.zookeeperQuorum("localhost:2181,localhost:2182,localhost:2183")
.zookeeperNodeParent("/hbase/root-dir");
HBase hbaseDesc1 = new HBase()
.version("1.4.3")
.tableName("testNs:table1")
.zookeeperQuorum("localhost:2181")
.zookeeperNodeParent("/hbase/root")
.writeBufferFlushInterval("2s")
.writeBufferFlushMaxRows(100)
.writeBufferFlushMaxSize("1mb");
return Arrays.asList(hbaseDesc0, hbaseDesc1);
}
示例2
private static Map<String, String> toMap(Descriptor... desc) {
final DescriptorProperties descriptorProperties = new DescriptorProperties();
for (Descriptor d : desc) {
descriptorProperties.putProperties(d.toProperties());
}
return descriptorProperties.asMap();
}
示例3
/**
* Returns an external catalog.
*/
@Deprecated
public static ExternalCatalog findAndCreateExternalCatalog(Descriptor descriptor) {
Map<String, String> properties = descriptor.toProperties();
return TableFactoryService
.find(ExternalCatalogFactory.class, properties)
.createExternalCatalog(properties);
}
示例4
@Override
protected List<Descriptor> descriptors() {
final Descriptor withoutDefaultDB = new GenericInMemoryCatalogDescriptor();
final Descriptor withDefaultDB = new GenericInMemoryCatalogDescriptor(TEST_DATABASE);
return Arrays.asList(withoutDefaultDB, withDefaultDB);
}
示例5
private static Map<String, String> toMap(Descriptor... desc) {
final DescriptorProperties descriptorProperties = new DescriptorProperties();
for (Descriptor d : desc) {
descriptorProperties.putProperties(d.toProperties());
}
return descriptorProperties.asMap();
}
示例6
@Override
protected List<Descriptor> descriptors() {
final Descriptor withoutDefaultDB = new GenericInMemoryCatalogDescriptor();
final Descriptor withDefaultDB = new GenericInMemoryCatalogDescriptor(TEST_DATABASE);
return Arrays.asList(withoutDefaultDB, withDefaultDB);
}
示例7
private static Map<String, String> toMap(Descriptor... desc) {
final DescriptorProperties descriptorProperties = new DescriptorProperties();
for (Descriptor d : desc) {
descriptorProperties.putProperties(d.toProperties());
}
return descriptorProperties.asMap();
}
示例8
@Override
protected List<Descriptor> descriptors() {
final Descriptor descriptor = new HiveCatalogDescriptor();
return Arrays.asList(descriptor);
}
示例9
/**
* Returns a table source matching the descriptor.
*/
public static <T> TableSource<T> findAndCreateTableSource(Descriptor descriptor) {
Map<String, String> properties = descriptor.toProperties();
return findAndCreateTableSource(properties);
}
示例10
/**
* Returns a table sink matching the descriptor.
*/
@SuppressWarnings("unchecked")
public static <T> TableSink<T> findAndCreateTableSink(Descriptor descriptor) {
Map<String, String> properties = descriptor.toProperties();
return findAndCreateTableSink(properties);
}
示例11
@Override
protected List<Descriptor> descriptors() {
final Descriptor descriptor = new HiveCatalogDescriptor();
return Arrays.asList(descriptor);
}
示例12
@Override
protected List<Descriptor> descriptors() {
final Descriptor descriptor = new HiveModuleDescriptor(hiveVersion);
return Arrays.asList(descriptor);
}
示例13
@Override
protected List<Descriptor> descriptors() {
return Arrays.asList(new CoreModuleDescriptor());
}
示例14
/**
* Finds a table factory of the given class, descriptor, and classloader.
*
* @param factoryClass desired factory class
* @param descriptor descriptor describing the factory configuration
* @param classLoader classloader for service loading
* @param <T> factory class type
* @return the matching factory
*/
public static <T extends TableFactory> T find(
Class<T> factoryClass,
Descriptor descriptor,
ClassLoader classLoader) {
Preconditions.checkNotNull(descriptor);
Preconditions.checkNotNull(classLoader);
return findSingleInternal(factoryClass, descriptor.toProperties(), Optional.of(classLoader));
}
示例15
/**
* Finds a table factory of the given class, descriptor, and classloader.
*
* @param factoryClass desired factory class
* @param descriptor descriptor describing the factory configuration
* @param classLoader classloader for service loading
* @param <T> factory class type
* @return the matching factory
*/
public static <T extends TableFactory> T find(
Class<T> factoryClass,
Descriptor descriptor,
ClassLoader classLoader) {
Preconditions.checkNotNull(descriptor);
Preconditions.checkNotNull(classLoader);
return findSingleInternal(factoryClass, descriptor.toProperties(), Optional.of(classLoader));
}
示例16
/**
* Finds a table factory of the given class and descriptor.
*
* @param factoryClass desired factory class
* @param descriptor descriptor describing the factory configuration
* @param <T> factory class type
* @return the matching factory
*/
public static <T extends TableFactory> T find(Class<T> factoryClass, Descriptor descriptor) {
Preconditions.checkNotNull(descriptor);
return findSingleInternal(factoryClass, descriptor.toProperties(), Optional.empty());
}
示例17
/**
* Finds a table factory of the given class and descriptor.
*
* @param factoryClass desired factory class
* @param descriptor descriptor describing the factory configuration
* @param <T> factory class type
* @return the matching factory
*/
public static <T extends TableFactory> T find(Class<T> factoryClass, Descriptor descriptor) {
Preconditions.checkNotNull(descriptor);
return findSingleInternal(factoryClass, descriptor.toProperties(), Optional.empty());
}