Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2876#discussion_r202722240
  
    --- Diff: 
nifi-nar-bundles/nifi-extension-utils/nifi-processor-utils/src/main/java/org/apache/nifi/processor/util/list/ListedEntity.java
 ---
    @@ -0,0 +1,44 @@
    +/*
    + * 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.nifi.processor.util.list;
    +
    +public class ListedEntity {
    +    /**
    +     * Milliseconds.
    +     */
    +    private long timestamp;
    +    /**
    +     * Bytes.
    +     */
    +    private long size;
    +
    +    public void setTimestamp(long timestamp) {
    --- End diff --
    
    I don't think these are ever called other than immediately after creating 
the object, to set the initial value. If they are, then this is not thread-safe 
but is accessed by multiple threads. If they are not, then it probably makes 
sense to just provide the size and timestamp as constructor arguments, no? At a 
minimum, it makes it clear when looking at the code that it's immutable and 
therefore threadsafe.


---

Reply via email to