[jira] [Work logged] (GOBBLIN-863) Handle race condition between concurrent Gobblin tasks performing Hive registration
[ https://issues.apache.org/jira/browse/GOBBLIN-863?focusedWorklogId=303347=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-303347 ] ASF GitHub Bot logged work on GOBBLIN-863: -- Author: ASF GitHub Bot Created on: 29/Aug/19 04:07 Start Date: 29/Aug/19 04:07 Worklog Time Spent: 10m Work Description: autumnust commented on issue #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#issuecomment-526012735 LGTM, thanks for fixing. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 303347) Time Spent: 3h 50m (was: 3h 40m) > Handle race condition between concurrent Gobblin tasks performing Hive > registration > --- > > Key: GOBBLIN-863 > URL: https://issues.apache.org/jira/browse/GOBBLIN-863 > Project: Apache Gobblin > Issue Type: Task > Components: hive-registration >Reporter: Zihan Li >Assignee: Abhishek Tiwari >Priority: Major > Time Spent: 3h 50m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.2#803003)
[GitHub] [incubator-gobblin] autumnust commented on issue #2719: [GOBBLIN-863]Handle race condition issue for hive registration
autumnust commented on issue #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#issuecomment-526012735 LGTM, thanks for fixing. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (GOBBLIN-863) Handle race condition between concurrent Gobblin tasks performing Hive registration
[ https://issues.apache.org/jira/browse/GOBBLIN-863?focusedWorklogId=303323=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-303323 ] ASF GitHub Bot logged work on GOBBLIN-863: -- Author: ASF GitHub Bot Created on: 29/Aug/19 02:06 Start Date: 29/Aug/19 02:06 Worklog Time Spent: 10m Work Description: codecov-io commented on issue #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#issuecomment-523697466 # [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2719?src=pr=h1) Report > Merging [#2719](https://codecov.io/gh/apache/incubator-gobblin/pull/2719?src=pr=desc) into [master](https://codecov.io/gh/apache/incubator-gobblin/commit/bd4a09ab77a4447490b25e31bc98cafbda9f2847?src=pr=desc) will **increase** coverage by `0.87%`. > The diff coverage is `3.37%`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/graphs/tree.svg?width=650=4MgURJ0bGc=150=pr)](https://codecov.io/gh/apache/incubator-gobblin/pull/2719?src=pr=tree) ```diff @@ Coverage Diff @@ ## master#2719 +/- ## + Coverage 44.13% 45.01% +0.87% - Complexity 8576 8740 +164 Files 1880 1884 +4 Lines 7017070266 +96 Branches 7700 7709 +9 + Hits 3097331627 +654 + Misses3631235709 -603 - Partials 2885 2930 +45 ``` | [Impacted Files](https://codecov.io/gh/apache/incubator-gobblin/pull/2719?src=pr=tree) | Coverage Δ | Complexity Δ | | |---|---|---|---| | [...che/gobblin/hive/metastore/HiveMetaStoreUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL21ldGFzdG9yZS9IaXZlTWV0YVN0b3JlVXRpbHMuamF2YQ==) | `31.83% <ø> (ø)` | `12 <0> (ø)` | :arrow_down: | | [...lin/hive/metastore/HiveMetaStoreBasedRegister.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL21ldGFzdG9yZS9IaXZlTWV0YVN0b3JlQmFzZWRSZWdpc3Rlci5qYXZh) | `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: | | [...ain/java/org/apache/gobblin/hive/HiveRegister.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL0hpdmVSZWdpc3Rlci5qYXZh) | `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: | | [...ain/java/org/apache/gobblin/hive/HiveLockImpl.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL0hpdmVMb2NrSW1wbC5qYXZh) | `0% <0%> (ø)` | `0 <0> (?)` | | | [.../java/org/apache/gobblin/hive/HiveLockFactory.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL0hpdmVMb2NrRmFjdG9yeS5qYXZh) | `0% <0%> (ø)` | `0 <0> (?)` | | | [...rc/main/java/org/apache/gobblin/hive/HiveLock.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL0hpdmVMb2NrLmphdmE=) | `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: | | [...org/apache/gobblin/hive/AutoCloseableHiveLock.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL0F1dG9DbG9zZWFibGVIaXZlTG9jay5qYXZh) | `0% <0%> (ø)` | `0 <0> (?)` | | | [...blin/runtime/locks/DistributedHiveLockFactory.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvbG9ja3MvRGlzdHJpYnV0ZWRIaXZlTG9ja0ZhY3RvcnkuamF2YQ==) | `0% <0%> (ø)` | `0 <0> (?)` | | | [...e/gobblin/runtime/locks/ZookeeperBasedJobLock.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvbG9ja3MvWm9va2VlcGVyQmFzZWRKb2JMb2NrLmphdmE=) | `63.33% <100%> (+63.33%)` | `15 <2> (+15)` | :arrow_up: | |
[GitHub] [incubator-gobblin] codecov-io edited a comment on issue #2719: [GOBBLIN-863]Handle race condition issue for hive registration
codecov-io edited a comment on issue #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#issuecomment-523697466 # [Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2719?src=pr=h1) Report > Merging [#2719](https://codecov.io/gh/apache/incubator-gobblin/pull/2719?src=pr=desc) into [master](https://codecov.io/gh/apache/incubator-gobblin/commit/bd4a09ab77a4447490b25e31bc98cafbda9f2847?src=pr=desc) will **increase** coverage by `0.87%`. > The diff coverage is `3.37%`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/graphs/tree.svg?width=650=4MgURJ0bGc=150=pr)](https://codecov.io/gh/apache/incubator-gobblin/pull/2719?src=pr=tree) ```diff @@ Coverage Diff @@ ## master#2719 +/- ## + Coverage 44.13% 45.01% +0.87% - Complexity 8576 8740 +164 Files 1880 1884 +4 Lines 7017070266 +96 Branches 7700 7709 +9 + Hits 3097331627 +654 + Misses3631235709 -603 - Partials 2885 2930 +45 ``` | [Impacted Files](https://codecov.io/gh/apache/incubator-gobblin/pull/2719?src=pr=tree) | Coverage Δ | Complexity Δ | | |---|---|---|---| | [...che/gobblin/hive/metastore/HiveMetaStoreUtils.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL21ldGFzdG9yZS9IaXZlTWV0YVN0b3JlVXRpbHMuamF2YQ==) | `31.83% <ø> (ø)` | `12 <0> (ø)` | :arrow_down: | | [...lin/hive/metastore/HiveMetaStoreBasedRegister.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL21ldGFzdG9yZS9IaXZlTWV0YVN0b3JlQmFzZWRSZWdpc3Rlci5qYXZh) | `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: | | [...ain/java/org/apache/gobblin/hive/HiveRegister.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL0hpdmVSZWdpc3Rlci5qYXZh) | `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: | | [...ain/java/org/apache/gobblin/hive/HiveLockImpl.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL0hpdmVMb2NrSW1wbC5qYXZh) | `0% <0%> (ø)` | `0 <0> (?)` | | | [.../java/org/apache/gobblin/hive/HiveLockFactory.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL0hpdmVMb2NrRmFjdG9yeS5qYXZh) | `0% <0%> (ø)` | `0 <0> (?)` | | | [...rc/main/java/org/apache/gobblin/hive/HiveLock.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL0hpdmVMb2NrLmphdmE=) | `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: | | [...org/apache/gobblin/hive/AutoCloseableHiveLock.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1oaXZlLXJlZ2lzdHJhdGlvbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZ29iYmxpbi9oaXZlL0F1dG9DbG9zZWFibGVIaXZlTG9jay5qYXZh) | `0% <0%> (ø)` | `0 <0> (?)` | | | [...blin/runtime/locks/DistributedHiveLockFactory.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvbG9ja3MvRGlzdHJpYnV0ZWRIaXZlTG9ja0ZhY3RvcnkuamF2YQ==) | `0% <0%> (ø)` | `0 <0> (?)` | | | [...e/gobblin/runtime/locks/ZookeeperBasedJobLock.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1ydW50aW1lL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL3J1bnRpbWUvbG9ja3MvWm9va2VlcGVyQmFzZWRKb2JMb2NrLmphdmE=) | `63.33% <100%> (+63.33%)` | `15 <2> (+15)` | :arrow_up: | | [...gobblin/cluster/ClusterEventMetadataGenerator.java](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree#diff-Z29iYmxpbi1jbHVzdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9nb2JibGluL2NsdXN0ZXIvQ2x1c3RlckV2ZW50TWV0YWRhdGFHZW5lcmF0b3IuamF2YQ==) | `87.5% <0%> (-12.5%)` | `4% <0%> (ø)` | | | ... and [52 more](https://codecov.io/gh/apache/incubator-gobblin/pull/2719/diff?src=pr=tree-more) | | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-gobblin/pull/2719?src=pr=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) >
[jira] [Work logged] (GOBBLIN-865) Add feature that enables PK-chunking in partition
[ https://issues.apache.org/jira/browse/GOBBLIN-865?focusedWorklogId=303317=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-303317 ] ASF GitHub Bot logged work on GOBBLIN-865: -- Author: ASF GitHub Bot Created on: 29/Aug/19 01:26 Start Date: 29/Aug/19 01:26 Worklog Time Spent: 10m Work Description: arekusuri commented on pull request #2722: GOBBLIN-865: Add feature that enables PK-chunking in partition URL: https://github.com/apache/incubator-gobblin/pull/2722 Dear Gobblin maintainers, Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below! ### JIRA - [ ] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR" - https://issues.apache.org/jira/browse/GOBBLIN-XXX ### Description - [ ] Here are some details about my PR, including screenshots (if applicable): ### Tests - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason: ### Commits - [ ] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)": 1. Subject is separated from body by a blank line 2. Subject is limited to 50 characters 3. Subject does not end with a period 4. Subject uses the imperative mood ("add", not "adding") 5. Body wraps at 72 characters 6. Body explains "what" and "why", not "how" This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 303317) Remaining Estimate: 0h Time Spent: 10m > Add feature that enables PK-chunking in partition > -- > > Key: GOBBLIN-865 > URL: https://issues.apache.org/jira/browse/GOBBLIN-865 > Project: Apache Gobblin > Issue Type: Task >Reporter: Alex Li >Priority: Major > Labels: salesforce > Time Spent: 10m > Remaining Estimate: 0h > > In SFDC(salesforce) connector, we have partitioning mechanisms to split a > giant query to multiple sub queries. There are 3 mechanisms: > * simple partition (equally split by time) > * dynamic pre-partition (generate histogram and split by row numbers) > * user specified partition (set up time range in job file) > However there are tables like Task and Contract are failing time to time to > fetch full data. > We may want to utilize PK-chunking to partition the query. > > The pk-chunking doc from SFDC - > [https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/async_api_headers_enable_pk_chunking.htm] -- This message was sent by Atlassian Jira (v8.3.2#803003)
[GitHub] [incubator-gobblin] arekusuri opened a new pull request #2722: GOBBLIN-865: Add feature that enables PK-chunking in partition
arekusuri opened a new pull request #2722: GOBBLIN-865: Add feature that enables PK-chunking in partition URL: https://github.com/apache/incubator-gobblin/pull/2722 Dear Gobblin maintainers, Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below! ### JIRA - [ ] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR" - https://issues.apache.org/jira/browse/GOBBLIN-XXX ### Description - [ ] Here are some details about my PR, including screenshots (if applicable): ### Tests - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason: ### Commits - [ ] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)": 1. Subject is separated from body by a blank line 2. Subject is limited to 50 characters 3. Subject does not end with a period 4. Subject uses the imperative mood ("add", not "adding") 5. Body wraps at 72 characters 6. Body explains "what" and "why", not "how" This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Created] (GOBBLIN-865) Add feature that enables PK-chunking in partition
Alex Li created GOBBLIN-865: --- Summary: Add feature that enables PK-chunking in partition Key: GOBBLIN-865 URL: https://issues.apache.org/jira/browse/GOBBLIN-865 Project: Apache Gobblin Issue Type: Task Reporter: Alex Li In SFDC(salesforce) connector, we have partitioning mechanisms to split a giant query to multiple sub queries. There are 3 mechanisms: * simple partition (equally split by time) * dynamic pre-partition (generate histogram and split by row numbers) * user specified partition (set up time range in job file) However there are tables like Task and Contract are failing time to time to fetch full data. We may want to utilize PK-chunking to partition the query. The pk-chunking doc from SFDC - [https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/async_api_headers_enable_pk_chunking.htm] -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Work logged] (GOBBLIN-863) Handle race condition between concurrent Gobblin tasks performing Hive registration
[ https://issues.apache.org/jira/browse/GOBBLIN-863?focusedWorklogId=303275=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-303275 ] ASF GitHub Bot logged work on GOBBLIN-863: -- Author: ASF GitHub Bot Created on: 28/Aug/19 22:37 Start Date: 28/Aug/19 22:37 Worklog Time Spent: 10m Work Description: ZihanLi58 commented on pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318821215 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { + throw new IOException(e); Review comment: Sure. I'll address that This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 303275) Time Spent: 3.5h (was: 3h 20m) > Handle race condition between concurrent Gobblin tasks performing Hive > registration > --- > > Key: GOBBLIN-863 > URL: https://issues.apache.org/jira/browse/GOBBLIN-863 > Project: Apache Gobblin > Issue Type: Task > Components: hive-registration >Reporter: Zihan Li >Assignee: Abhishek Tiwari >Priority: Major > Time Spent: 3.5h > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.2#803003)
[GitHub] [incubator-gobblin] ZihanLi58 commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration
ZihanLi58 commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318821215 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { + throw new IOException(e); Review comment: Sure. I'll address that This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (GOBBLIN-863) Handle race condition between concurrent Gobblin tasks performing Hive registration
[ https://issues.apache.org/jira/browse/GOBBLIN-863?focusedWorklogId=303267=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-303267 ] ASF GitHub Bot logged work on GOBBLIN-863: -- Author: ASF GitHub Bot Created on: 28/Aug/19 22:09 Start Date: 28/Aug/19 22:09 Worklog Time Spent: 10m Work Description: autumnust commented on pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318813950 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { + throw new IOException(e); Review comment: Fair enough. In that case, shall we specify `JobLockException` instead of `Exception` ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 303267) Time Spent: 3h 20m (was: 3h 10m) > Handle race condition between concurrent Gobblin tasks performing Hive > registration > --- > > Key: GOBBLIN-863 > URL: https://issues.apache.org/jira/browse/GOBBLIN-863 > Project: Apache Gobblin > Issue Type: Task > Components: hive-registration >Reporter: Zihan Li >Assignee: Abhishek Tiwari >Priority: Major > Time Spent: 3h 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.2#803003)
[GitHub] [incubator-gobblin] autumnust commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration
autumnust commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318813950 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { + throw new IOException(e); Review comment: Fair enough. In that case, shall we specify `JobLockException` instead of `Exception` ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (GOBBLIN-863) Handle race condition between concurrent Gobblin tasks performing Hive registration
[ https://issues.apache.org/jira/browse/GOBBLIN-863?focusedWorklogId=303081=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-303081 ] ASF GitHub Bot logged work on GOBBLIN-863: -- Author: ASF GitHub Bot Created on: 28/Aug/19 18:23 Start Date: 28/Aug/19 18:23 Worklog Time Spent: 10m Work Description: ZihanLi58 commented on pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318727218 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { + throw new IOException(e); Review comment: Because it's a JobLockException, I want to catch it and throw as a IOException with can be caught later. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 303081) Time Spent: 3h 10m (was: 3h) > Handle race condition between concurrent Gobblin tasks performing Hive > registration > --- > > Key: GOBBLIN-863 > URL: https://issues.apache.org/jira/browse/GOBBLIN-863 > Project: Apache Gobblin > Issue Type: Task > Components: hive-registration >Reporter: Zihan Li >Assignee: Abhishek Tiwari >Priority: Major > Time Spent: 3h 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.2#803003)
[GitHub] [incubator-gobblin] ZihanLi58 commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration
ZihanLi58 commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318727218 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { + throw new IOException(e); Review comment: Because it's a JobLockException, I want to catch it and throw as a IOException with can be caught later. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (GOBBLIN-863) Handle race condition between concurrent Gobblin tasks performing Hive registration
[ https://issues.apache.org/jira/browse/GOBBLIN-863?focusedWorklogId=303078=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-303078 ] ASF GitHub Bot logged work on GOBBLIN-863: -- Author: ASF GitHub Bot Created on: 28/Aug/19 18:20 Start Date: 28/Aug/19 18:20 Worklog Time Spent: 10m Work Description: autumnust commented on pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318725927 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { + throw new IOException(e); Review comment: Why this exception needs to be caught and throw again? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 303078) Time Spent: 3h (was: 2h 50m) > Handle race condition between concurrent Gobblin tasks performing Hive > registration > --- > > Key: GOBBLIN-863 > URL: https://issues.apache.org/jira/browse/GOBBLIN-863 > Project: Apache Gobblin > Issue Type: Task > Components: hive-registration >Reporter: Zihan Li >Assignee: Abhishek Tiwari >Priority: Major > Time Spent: 3h > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.2#803003)
[jira] [Work logged] (GOBBLIN-863) Handle race condition between concurrent Gobblin tasks performing Hive registration
[ https://issues.apache.org/jira/browse/GOBBLIN-863?focusedWorklogId=303077=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-303077 ] ASF GitHub Bot logged work on GOBBLIN-863: -- Author: ASF GitHub Bot Created on: 28/Aug/19 18:20 Start Date: 28/Aug/19 18:20 Worklog Time Spent: 10m Work Description: autumnust commented on pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318725463 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { Review comment: Why this exception needs to be caught and throw again? And why the exception handling between Distributed lock need be different from local lock ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 303077) Time Spent: 2h 50m (was: 2h 40m) > Handle race condition between concurrent Gobblin tasks performing Hive > registration > --- > > Key: GOBBLIN-863 > URL: https://issues.apache.org/jira/browse/GOBBLIN-863 > Project: Apache Gobblin > Issue Type: Task > Components: hive-registration >Reporter: Zihan Li >Assignee: Abhishek Tiwari >Priority: Major > Time Spent: 2h 50m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.2#803003)
[GitHub] [incubator-gobblin] autumnust commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration
autumnust commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318725463 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { Review comment: Why this exception needs to be caught and throw again? And why the exception handling between Distributed lock need be different from local lock ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (GOBBLIN-863) Handle race condition between concurrent Gobblin tasks performing Hive registration
[ https://issues.apache.org/jira/browse/GOBBLIN-863?focusedWorklogId=303076=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-303076 ] ASF GitHub Bot logged work on GOBBLIN-863: -- Author: ASF GitHub Bot Created on: 28/Aug/19 18:19 Start Date: 28/Aug/19 18:19 Worklog Time Spent: 10m Work Description: autumnust commented on pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318725463 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { Review comment: Why this exception needs to be caught and throw again? And why the exception handling between Distributed lock need be different from local lock ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 303076) Time Spent: 2h 40m (was: 2.5h) > Handle race condition between concurrent Gobblin tasks performing Hive > registration > --- > > Key: GOBBLIN-863 > URL: https://issues.apache.org/jira/browse/GOBBLIN-863 > Project: Apache Gobblin > Issue Type: Task > Components: hive-registration >Reporter: Zihan Li >Assignee: Abhishek Tiwari >Priority: Major > Time Spent: 2h 40m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.2#803003)
[GitHub] [incubator-gobblin] autumnust commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration
autumnust commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318725927 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { + throw new IOException(e); Review comment: Why this exception needs to be caught and throw again? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-gobblin] autumnust commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration
autumnust commented on a change in pull request #2719: [GOBBLIN-863]Handle race condition issue for hive registration URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r318725463 ## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/DistributedHiveLockFactory.java ## @@ -0,0 +1,53 @@ +/* + * 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 org.apache.gobblin.runtime.locks; + +import java.io.IOException; +import java.util.Properties; +import org.apache.gobblin.hive.HiveLockFactory; +import org.apache.gobblin.hive.HiveLockImpl; + +/** + * A lock factory that extends {@link HiveLockFactory} provide a get method for a distributed lock for a specific object + */ +public class DistributedHiveLockFactory extends HiveLockFactory { + public DistributedHiveLockFactory(Properties properties) { +super(properties); + } + public HiveLockImpl get(String name) { +return new HiveLockImpl(new ZookeeperBasedJobLock(properties, name)) { + @Override + public void lock() throws IOException { +try { + this.lock.lock(); +} catch (Exception e) { + throw new IOException(e); +} + } + + @Override + public void unlock() throws IOException { +try { + this.lock.unlock(); +} catch (Exception e) { Review comment: Why this exception needs to be caught and throw again? And why the exception handling between Distributed lock need be different from local lock ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services