storm-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From HeartSaVioR <...@git.apache.org>
Subject [GitHub] storm pull request #2502: new PR for STORM-2306 : Messaging subsystem redesi...
Date Tue, 13 Feb 2018 22:00:15 GMT
Github user HeartSaVioR commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2502#discussion_r168015462
  
    --- Diff: storm-client/src/jvm/org/apache/storm/messaging/netty/BackPressureStatus.java
---
    @@ -0,0 +1,75 @@
    +/*
    + * 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.storm.messaging.netty;
    +
    +import org.apache.storm.serialization.KryoValuesDeserializer;
    +import org.apache.storm.serialization.KryoValuesSerializer;
    +import org.jboss.netty.buffer.ChannelBuffer;
    +import org.jboss.netty.buffer.ChannelBuffers;
    +
    +import java.io.IOException;
    +import java.util.Collection;
    +import java.util.concurrent.atomic.AtomicLong;
    +
    +// Instances of this type are sent from NettyWorker to upstream WorkerTransfer to indicate
BackPressure situation
    +public class BackPressureStatus {
    +    public static final short IDENTIFIER = (short)-600;
    +    private static final int SIZE_OF_ID = 2; // size if IDENTIFIER
    +    private static final int SIZE_OF_INT = 4;
    +
    +    private static AtomicLong bpCount = new AtomicLong(0);
    +
    +    public String workerId;
    +    public final long id;                       // monotonically increasing id
    --- End diff --
    
    Sorry to leave two duplicated comments: I commented to old commit.
    
    Just wondering: the characteristic of `monotonically increasing` guarantee `id` to be
unique in a worker, but not among workers, and also reset to 0 after worker crash and restart.
Does it hurt the backpressure logic at any chance?


---

Mime
View raw message