mynameborat 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_r262817152
 
 

 ##########
 File path: 
samza-core/src/main/java/org/apache/samza/coordinator/DistributedReadWriteLock.java
 ##########
 @@ -0,0 +1,70 @@
+/*
+ * 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
+ * At any point in time, only one processor can hold the lock
+ * The processor that has acquired the lock, holds it until it does `unlock` 
explicitly
+ * The first processor to acquire the lock should be given a WRITE access
+ * All other subsequent requests should acquire only READ access
+ */
+public interface DistributedReadWriteLock {
 
 Review comment:
   Can we expect a predicate that decides who gets the read lock vs write? By 
this, you can reuse the read write locks for different scenarios in future as 
opposed to having it only purposed for handing the write access to first 
processor that acquires the lock and read access to the rest .

----------------------------------------------------------------
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

Reply via email to