[BEAM-3214] Add integration test for HBaseIO.#5499
Conversation
|
R: @iemejia |
|
CC: @aromanenko-dev |
| spec: | ||
| containers: | ||
| - name: hbase | ||
| image: harisekhon/hbase:latest |
There was a problem hiding this comment.
We should probably pin this to version 1.2 since this is the official stable one and the one the connector uses.
There was a problem hiding this comment.
The latest points to 1.3 version currently, but to be strict with the version specified in build.gradle I will pin this to 1.2 as there is docker tag with this version available.
| /* HBase */ | ||
| @Description("HBase host") | ||
| @Default.String("HBase-host") | ||
| String getHbaseServerName(); |
There was a problem hiding this comment.
We decided to not expand this Options object anymore. Please create a PipelineOptions specific for HBase see HCatalogIO for ref.
There was a problem hiding this comment.
Thanks, I wasn't aware of that.
| /** | ||
| * Produces test rows. | ||
| */ | ||
| public static class ConstructMutations extends DoFn<TestRow, Mutation> { |
| /** | ||
| * Read rows from Table. | ||
| */ | ||
| public static class SelectNameFn extends DoFn<Result, String> { |
| */ | ||
| @RunWith(JUnit4.class) | ||
| public class HBaseIOIT { | ||
| private static final Logger LOG = LoggerFactory.getLogger(HBaseIOIT.class); |
There was a problem hiding this comment.
This is never used so maybe remove.
| set -e | ||
|
|
||
| kubectl create -f hbase-single-node-cluster.yml | ||
|
|
There was a problem hiding this comment.
I would remove this space and the one in line 28 (ultra minor nitpick)
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # Start HBase cluster. |
There was a problem hiding this comment.
remove this one and the next line to be consistent with the other setup.sh files
| external_ip="$(kubectl get svc hbase-external -o jsonpath='{.status.loadBalancer.ingress[0].ip}')" | ||
|
|
||
| hbase_master_pod_name="$(kubectl get pods --selector=name=hbase -o jsonpath='{.items[*].metadata.name}')" | ||
|
|
There was a problem hiding this comment.
same comment for spaces as above
| # 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. | ||
| # |
There was a problem hiding this comment.
Please remove the '# char so this does not get mingled with the ASF license.
| # 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. | ||
| # |
| # 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. | ||
| # |
| # 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. | ||
| # |
| # 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. | ||
| # |
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
|
|
| * | ||
| */ | ||
| @RunWith(JUnit4.class) | ||
| public class HBaseIOIT { |
There was a problem hiding this comment.
Do you use IntelliJ if so can you please format this file with the google-java-plugin (this is not mandatory but it is what most people here use and probably will be automatized in the future).
| # should be added to /etc/hosts file in order to work with HBase cluster. | ||
| # | ||
|
|
||
| #!/bin/sh |
There was a problem hiding this comment.
shebangs must be the first line in the file so probably just move it to the top in this in all the shell files.
#!/bin/sh
#
...
There was a problem hiding this comment.
Extra points if you open a subsequent PR to fix this in all the other shell scripts (the non-hbase ones) (+ eventual fixes for shellcheck issues).
There was a problem hiding this comment.
Ok this makes sense. In this PR I just wanted to be consistent with current script pattern, but this could be easily fixed.
| hbase_master_namespace="$(kubectl get pods --selector=name=hbase -o jsonpath='{.items[*].metadata.namespace}')" | ||
|
|
||
| echo "For local tests please add the following entry to /etc/hosts file" | ||
| echo ${external_ip}$'\t'${hbase_master_pod_name}".hbase.${hbase_master_namespace}.svc.cluster.local" |
There was a problem hiding this comment.
SC2086: Double quote to prevent globbing and word splitting.
^-- SC2039: In POSIX sh, $'..' is undefined.
^-- SC2086: Double quote to prevent globbing and word splitting.
Pro tip: always pass a run of shellcheck in the shell scripts for specific issues like this.
https://www.shellcheck.net/
| #!/bin/sh | ||
| set -e | ||
|
|
||
| kubectl create -f hbase-single-node.yml No newline at end of file |
There was a problem hiding this comment.
when running the script it complaines on missing file, maybe it is hbase-single-node-cluster.yml ?
There was a problem hiding this comment.
exactly I was used different naming convention at the beginning of working at this PR
| #!/bin/sh | ||
| set -e | ||
|
|
||
| kubectl delete -f hbase-single-node.yml No newline at end of file |
There was a problem hiding this comment.
when running the script it complaines on missing file, maybe it is hbase-single-node-cluster.yml ?
|
@iemejia this is ready for another round. |
|
Run Java PostCommit |
|
Run Java PreCommit |
|
@iemejia sorry I run post commit tests by mistake instead of precommit. Now waiting for 2 checks to be completed. |
This PR contains:
Follow this checklist to help us incorporate your contribution quickly and easily:
[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.It will help us expedite review of your Pull Request if you tag someone (e.g.
@username) to look at it.