Skip to content
Permalink
Browse files

[SMALLFIX]Change the AllocatorFactory.java using "static"

pr-link: #9075
change-id: cid-2c795e884707bd169ce53ebd9bf9e35e5a5d499d
  • Loading branch information...
naive4E4A55 authored and alluxio-bot committed May 14, 2019
1 parent d767602 commit 7e7c2c1a59557b9dddb2dff79bddd064a3436603
@@ -11,13 +11,14 @@

package alluxio.worker.block.allocator;

import static org.junit.Assert.assertTrue;

import alluxio.conf.ServerConfiguration;
import alluxio.conf.PropertyKey;
import alluxio.worker.block.BlockMetadataManagerView;
import alluxio.worker.block.TieredBlockStoreTestUtils;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -56,7 +57,7 @@ public void after() {
public void createGreedyAllocator() {
ServerConfiguration.set(PropertyKey.WORKER_ALLOCATOR_CLASS, GreedyAllocator.class.getName());
Allocator allocator = Allocator.Factory.create(mManagerView);
Assert.assertTrue(allocator instanceof GreedyAllocator);
assertTrue(allocator instanceof GreedyAllocator);
}

/**
@@ -67,7 +68,7 @@ public void createGreedyAllocator() {
public void createMaxFreeAllocator() {
ServerConfiguration.set(PropertyKey.WORKER_ALLOCATOR_CLASS, MaxFreeAllocator.class.getName());
Allocator allocator = Allocator.Factory.create(mManagerView);
Assert.assertTrue(allocator instanceof MaxFreeAllocator);
assertTrue(allocator instanceof MaxFreeAllocator);
}

/**
@@ -79,7 +80,7 @@ public void createRoundRobinAllocator() {
ServerConfiguration.set(PropertyKey.WORKER_ALLOCATOR_CLASS,
RoundRobinAllocator.class.getName());
Allocator allocator = Allocator.Factory.create(mManagerView);
Assert.assertTrue(allocator instanceof RoundRobinAllocator);
assertTrue(allocator instanceof RoundRobinAllocator);
}

/**
@@ -91,6 +92,6 @@ public void createDefaultAllocator() {
// Create a new instance of Alluxio configuration with original properties to test the default
// behavior of create.
Allocator allocator = Allocator.Factory.create(mManagerView);
Assert.assertTrue(allocator instanceof MaxFreeAllocator);
assertTrue(allocator instanceof MaxFreeAllocator);
}
}

0 comments on commit 7e7c2c1

Please sign in to comment.
You can’t perform that action at this time.