-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BitSail]Supprt bitsail table catalog. (#181)
Support table catalog in bitsail.
- Loading branch information
Showing
82 changed files
with
2,321 additions
and
1,944 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
bitsail-base/src/main/java/com/bytedance/bitsail/base/catalog/TableCatalogFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package com.bytedance.bitsail.base.catalog; | ||
|
||
import com.bytedance.bitsail.base.component.ComponentBuilder; | ||
import com.bytedance.bitsail.base.connector.BuilderGroup; | ||
import com.bytedance.bitsail.base.execution.ExecutionEnviron; | ||
import com.bytedance.bitsail.common.catalog.table.TableCatalog; | ||
import com.bytedance.bitsail.common.configuration.BitSailConfiguration; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* Created 2022/5/23 | ||
*/ | ||
public interface TableCatalogFactory extends Serializable, ComponentBuilder { | ||
|
||
/** | ||
* Create a table catalog. | ||
* | ||
* @param executionEnviron execution environment | ||
* @param connectorConfiguration configuration for the reader/writer | ||
*/ | ||
TableCatalog createTableCatalog(BuilderGroup builderGroup, | ||
ExecutionEnviron executionEnviron, | ||
BitSailConfiguration connectorConfiguration); | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
bitsail-base/src/main/java/com/bytedance/bitsail/base/catalog/TableCatalogFactoryHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package com.bytedance.bitsail.base.catalog; | ||
|
||
import com.bytedance.bitsail.base.component.DefaultComponentBuilderLoader; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
|
||
public class TableCatalogFactoryHelper { | ||
|
||
public static TableCatalogFactory getTableCatalogFactory(String connectorName) { | ||
DefaultComponentBuilderLoader<TableCatalogFactory> loader = | ||
new DefaultComponentBuilderLoader<>(TableCatalogFactory.class); | ||
|
||
return loader.loadComponent(StringUtils.lowerCase(connectorName), false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
bitsail-base/src/main/java/com/bytedance/bitsail/base/connector/BuilderGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package com.bytedance.bitsail.base.connector; | ||
|
||
public enum BuilderGroup { | ||
|
||
READER, | ||
WRITER, | ||
TRANSFORMER; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
bitsail-base/src/main/java/com/bytedance/bitsail/base/extension/SchemaAlignmentable.java
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
...ail-base/src/main/java/com/bytedance/bitsail/base/extension/TypeInfoConverterFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package com.bytedance.bitsail.base.extension; | ||
|
||
import com.bytedance.bitsail.common.type.TypeInfoConverter; | ||
|
||
import java.io.Serializable; | ||
|
||
public interface TypeInfoConverterFactory extends Serializable { | ||
|
||
TypeInfoConverter createTypeInfoConverter(); | ||
} |
47 changes: 47 additions & 0 deletions
47
bitsail-common/src/main/java/com/bytedance/bitsail/common/catalog/TableCatalogErrorCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package com.bytedance.bitsail.common.catalog; | ||
|
||
import com.bytedance.bitsail.common.exception.ErrorCode; | ||
|
||
public enum TableCatalogErrorCode implements ErrorCode { | ||
|
||
TABLE_CATALOG_TABLE_NOT_EXISTS("Table-Catalog-1", "Catalog table not exists."), | ||
|
||
; | ||
private final String code; | ||
|
||
private final String description; | ||
|
||
TableCatalogErrorCode(String code, String description) { | ||
this.code = code; | ||
this.description = description; | ||
} | ||
|
||
@Override | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return description; | ||
} | ||
} |
Oops, something went wrong.