/*
 * 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.rocketmq.store;

import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.Test;


public class StoreStatsServiceTest {

  @Test
  public void getSinglePutMessageTopicSizeTotal() throws Exception {
    final StoreStatsService storeStatsService = new StoreStatsService();
    int num = Runtime.getRuntime().availableProcessors() * 2;
    for (int j = 0; j < 100; j++) {
      final AtomicReference<AtomicLong> reference = new AtomicReference<>(null);
      final CountDownLatch latch = new CountDownLatch(num);
      final CyclicBarrier barrier = new CyclicBarrier(num);
      for (int i = 0; i < num; i++) {
        new Thread(new Runnable() {
          @Override
          public void run() {
            try {
              barrier.await();
              AtomicLong atomicLong = storeStatsService.getSinglePutMessageTopicSizeTotal("test");
              if(reference.compareAndSet(null,atomicLong)){
              }else if (reference.get() != atomicLong){
                throw new RuntimeException("Reference should be same!");
              }
            } catch (InterruptedException | BrokenBarrierException e) {
              e.printStackTrace();
            }finally {
              latch.countDown();
            }
          }
        }).start();
      }
      latch.await();
    }
  }

  @Test
  public void getSinglePutMessageTopicTimesTotal() throws Exception {
    final StoreStatsService storeStatsService = new StoreStatsService();
    int num = Runtime.getRuntime().availableProcessors() * 2;
    for (int j = 0; j < 100; j++) {
      final AtomicReference<AtomicLong> reference = new AtomicReference<>(null);
      final CountDownLatch latch = new CountDownLatch(num);
      final CyclicBarrier barrier = new CyclicBarrier(num);
      for (int i = 0; i < num; i++) {
        new Thread(new Runnable() {
          @Override
          public void run() {
            try {
              barrier.await();
              AtomicLong atomicLong = storeStatsService.getSinglePutMessageTopicTimesTotal("test");
              if(reference.compareAndSet(null,atomicLong)){
              }else if (reference.get() != atomicLong){
                throw new RuntimeException("Reference should be same!");
              }
            } catch (InterruptedException | BrokenBarrierException e) {
              e.printStackTrace();
            }finally {
              latch.countDown();
            }
          }
        }).start();
      }
      latch.await();
    }
  }

}
@@ -1,806 +1,4 @@
-/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A
 pack
@@ -291,16 +291,39 @@
 .Test;%0A%0A
+/**%0A * @author song%0A */
 %0Apublic 

Revert "Fix licence"