vjagadish1989 commented on a change in pull request #938: SAMZA-1531: Support 
run.id in standalone for batch processing.
URL: https://github.com/apache/samza/pull/938#discussion_r277103650
 
 

 ##########
 File path: 
samza-core/src/main/java/org/apache/samza/coordinator/DistributedReadWriteLock.java
 ##########
 @@ -0,0 +1,82 @@
+/*
+ * 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.samza.coordinator;
+
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+
+/**
+ * Lock to acquire read access or write access.
 
 Review comment:
   Would prefer to avoid interfaces with extremely specific requirements in 
CoordinationUtils. 
   
   ```
   AccessType lock(long timeout, TimeUnit unit) throws TimeoutException
   unlock()
   ```
   This is not a general-purpose r-w lock interface for a couple of reasons:
   - Typical r-w locks are single-writer multi-reader + optionally biased 
locking
   - Users of a r-w lock interface should be allowed to specify the intent(eg: 
lock for reads vs writes) when they invoke it. The interface should allow it, 
in which case it returns immediately or deny it, in which case it blocks
   
   Can we re-think the problem in-terms of more general distributed 
coordination primitives eg: locks, barriers, semaphores, latches? maybe we 
don't need this interface and the corresponding impl. then

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to