[ https://issues.apache.org/jira/browse/BEAM-4681?focusedWorklogId=179676&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-179676 ]
ASF GitHub Bot logged work on BEAM-4681: ---------------------------------------- Author: ASF GitHub Bot Created on: 29/Dec/18 11:32 Start Date: 29/Dec/18 11:32 Worklog Time Spent: 10m Work Description: mxm commented on pull request #7359: [BEAM-4681] Address synchronization issue for portable timers URL: https://github.com/apache/beam/pull/7359#discussion_r244481038 ########## File path: runners/flink/src/main/java/org/apache/beam/runners/flink/translation/utils/NoopLock.java ########## @@ -0,0 +1,72 @@ +/* + * 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.beam.runners.flink.translation.utils; + +import java.io.Serializable; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; +import javax.annotation.Nonnull; + +/** + * A lock which can always be acquired. It should not be used when a proper lock is required, but it + * is useful as a performance optimization when locking is not necessary but the code paths have to + * be shared between the locking and the non-locking variant. + * + * <p>For example, in {@link + * org.apache.beam.runners.flink.translation.wrappers.streaming.ExecutableStageDoFnOperator}, the + * locking on the state backend is only required when both timers and state are used. + */ +public class NoopLock implements Lock, Serializable { Review comment: I thought about adding it to the SDK, but I wasn't sure how useful this would be for reuse. The use case is kind of a special optimization. I don't know how much performance it gives, as this depends on the number of state requests, but it also provides a hint how the locking granularity works for people reading the Runner code. There is a good chance someone who needs it would find it and move it to a different location. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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: 179676) Time Spent: 26h (was: 25h 50m) > Integrate support for timers using the portability APIs into Flink > ------------------------------------------------------------------ > > Key: BEAM-4681 > URL: https://issues.apache.org/jira/browse/BEAM-4681 > Project: Beam > Issue Type: Sub-task > Components: runner-flink > Reporter: Luke Cwik > Assignee: Maximilian Michels > Priority: Major > Labels: portability, portability-flink > Fix For: 2.9.0 > > Time Spent: 26h > Remaining Estimate: 0h > > Consider using the code produced in BEAM-4658 to support timers. -- This message was sent by Atlassian JIRA (v7.6.3#76005)