-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from AbsaOSS/feature/83-components-discovery
Feature/83 components discovery
- Loading branch information
Showing
65 changed files
with
1,442 additions
and
486 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
api/src/main/scala/za/co/absa/hyperdrive/ingestor/api/ComponentFactory.scala
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,22 @@ | ||
/* | ||
* Copyright 2018 ABSA Group Limited | ||
* | ||
* Licensed 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 za.co.absa.hyperdrive.ingestor.api | ||
|
||
import org.apache.commons.configuration2.Configuration | ||
|
||
trait ComponentFactory[T] extends HasComponentAttributes { | ||
def apply(config: Configuration): T | ||
} |
25 changes: 25 additions & 0 deletions
25
api/src/main/scala/za/co/absa/hyperdrive/ingestor/api/ComponentFactoryProvider.scala
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,25 @@ | ||
/* | ||
* Copyright 2018 ABSA Group Limited | ||
* | ||
* Licensed 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 za.co.absa.hyperdrive.ingestor.api | ||
|
||
/** | ||
* Implementations of this trait are responsible for providing an instance of a [[ComponentFactory]] via the | ||
* service provider interface (SPI) and need to be registered in a provider configuration file under META-INF/services | ||
* Implementations must have a no-args constructor to be instantiable. | ||
*/ | ||
trait ComponentFactoryProvider[T <: ComponentFactory[_]] { | ||
def getComponentFactory: T | ||
} |
61 changes: 61 additions & 0 deletions
61
api/src/main/scala/za/co/absa/hyperdrive/ingestor/api/HasComponentAttributes.scala
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,61 @@ | ||
/* | ||
* Copyright 2018 ABSA Group Limited | ||
* | ||
* Licensed 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 za.co.absa.hyperdrive.ingestor.api | ||
|
||
case class PropertyMetadata( | ||
/** | ||
* A human readable label for this property. | ||
*/ | ||
label: String, | ||
|
||
/** | ||
* An optional text that gives a detailed description of this property. | ||
*/ | ||
hint: Option[String], | ||
|
||
/** | ||
* true if the property is required, false otherwise | ||
*/ | ||
required: Boolean) | ||
|
||
/** | ||
* This trait should be implemented by all implementations of [[ComponentFactory]] to provide a self-description | ||
* how the component should be used and configured. This information may be used by external applications | ||
* that automatically discover components | ||
*/ | ||
trait HasComponentAttributes { | ||
/** | ||
* @return a human readable name of the component. | ||
*/ | ||
def getName: String | ||
|
||
/** | ||
* @return a description for the component. | ||
*/ | ||
def getDescription: String | ||
|
||
/** | ||
* @return a map describing configuration properties for this component. The keys have to be unique to avoid | ||
* name clashes with properties from other components. | ||
*/ | ||
def getProperties: Map[String, PropertyMetadata] | ||
|
||
/** | ||
* @return a prefix to be used for arbitrary extra configuration. Typically extra configuration is required | ||
* to pass on configuration properties, e.g. to DataStreamWriter.options | ||
*/ | ||
def getExtraConfigurationPrefix: Option[String] = None | ||
} |
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
20 changes: 20 additions & 0 deletions
20
.../main/scala/za/co/absa/hyperdrive/ingestor/api/decoder/StreamDecoderFactoryProvider.scala
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,20 @@ | ||
/* | ||
* Copyright 2018 ABSA Group Limited | ||
* | ||
* Licensed 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 za.co.absa.hyperdrive.ingestor.api.decoder | ||
|
||
import za.co.absa.hyperdrive.ingestor.api.ComponentFactoryProvider | ||
|
||
trait StreamDecoderFactoryProvider extends ComponentFactoryProvider[StreamDecoderFactory] |
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
20 changes: 20 additions & 0 deletions
20
.../main/scala/za/co/absa/hyperdrive/ingestor/api/manager/StreamManagerFactoryProvider.scala
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,20 @@ | ||
/* | ||
* Copyright 2018 ABSA Group Limited | ||
* | ||
* Licensed 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 za.co.absa.hyperdrive.ingestor.api.manager | ||
|
||
import za.co.absa.hyperdrive.ingestor.api.ComponentFactoryProvider | ||
|
||
trait StreamManagerFactoryProvider extends ComponentFactoryProvider[StreamManagerFactory] |
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
20 changes: 20 additions & 0 deletions
20
...rc/main/scala/za/co/absa/hyperdrive/ingestor/api/reader/StreamReaderFactoryProvider.scala
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,20 @@ | ||
/* | ||
* Copyright 2018 ABSA Group Limited | ||
* | ||
* Licensed 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 za.co.absa.hyperdrive.ingestor.api.reader | ||
|
||
import za.co.absa.hyperdrive.ingestor.api.ComponentFactoryProvider | ||
|
||
trait StreamReaderFactoryProvider extends ComponentFactoryProvider[StreamReaderFactory] |
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
20 changes: 20 additions & 0 deletions
20
...ala/za/co/absa/hyperdrive/ingestor/api/transformer/StreamTransformerFactoryProvider.scala
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,20 @@ | ||
/* | ||
* Copyright 2018 ABSA Group Limited | ||
* | ||
* Licensed 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 za.co.absa.hyperdrive.ingestor.api.transformer | ||
|
||
import za.co.absa.hyperdrive.ingestor.api.ComponentFactoryProvider | ||
|
||
trait StreamTransformerFactoryProvider extends ComponentFactoryProvider[StreamTransformerFactory] |
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
20 changes: 20 additions & 0 deletions
20
...rc/main/scala/za/co/absa/hyperdrive/ingestor/api/writer/StreamWriterFactoryProvider.scala
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,20 @@ | ||
/* | ||
* Copyright 2018 ABSA Group Limited | ||
* | ||
* Licensed 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 za.co.absa.hyperdrive.ingestor.api.writer | ||
|
||
import za.co.absa.hyperdrive.ingestor.api.ComponentFactoryProvider | ||
|
||
trait StreamWriterFactoryProvider extends ComponentFactoryProvider[StreamWriterFactory] |
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
Oops, something went wrong.