48
48
import org .apache .accumulo .core .manager .balancer .BalanceParamsImpl ;
49
49
import org .apache .accumulo .core .manager .balancer .TabletServerIdImpl ;
50
50
import org .apache .accumulo .core .manager .balancer .TabletStatisticsImpl ;
51
+ import org .apache .accumulo .core .metadata .schema .Ample .DataLevel ;
51
52
import org .apache .accumulo .core .spi .balancer .data .TServerStatus ;
52
53
import org .apache .accumulo .core .spi .balancer .data .TabletMigration ;
53
54
import org .apache .accumulo .core .spi .balancer .data .TabletServerId ;
@@ -97,7 +98,7 @@ public void testBalance() {
97
98
List <TabletMigration > migrationsOut = new ArrayList <>();
98
99
long wait =
99
100
this .balance (new BalanceParamsImpl (Collections .unmodifiableSortedMap (createCurrent (15 )),
100
- migrations , migrationsOut , " USER" , environment .getTableIdMap ()));
101
+ migrations , migrationsOut , DataLevel . USER . name () , environment .getTableIdMap ()));
101
102
assertEquals (20000 , wait );
102
103
// should balance four tablets in one of the tables before reaching max
103
104
assertEquals (4 , migrationsOut .size ());
@@ -108,7 +109,7 @@ public void testBalance() {
108
109
}
109
110
migrationsOut .clear ();
110
111
wait = this .balance (new BalanceParamsImpl (Collections .unmodifiableSortedMap (createCurrent (15 )),
111
- migrations , migrationsOut , " USER" , environment .getTableIdMap ()));
112
+ migrations , migrationsOut , DataLevel . USER . name () , environment .getTableIdMap ()));
112
113
assertEquals (20000 , wait );
113
114
// should balance four tablets in one of the other tables before reaching max
114
115
assertEquals (4 , migrationsOut .size ());
@@ -119,7 +120,7 @@ public void testBalance() {
119
120
}
120
121
migrationsOut .clear ();
121
122
wait = this .balance (new BalanceParamsImpl (Collections .unmodifiableSortedMap (createCurrent (15 )),
122
- migrations , migrationsOut , " USER" , environment .getTableIdMap ()));
123
+ migrations , migrationsOut , DataLevel . USER . name () , environment .getTableIdMap ()));
123
124
assertEquals (20000 , wait );
124
125
// should balance four tablets in one of the other tables before reaching max
125
126
assertEquals (4 , migrationsOut .size ());
@@ -130,7 +131,7 @@ public void testBalance() {
130
131
}
131
132
migrationsOut .clear ();
132
133
wait = this .balance (new BalanceParamsImpl (Collections .unmodifiableSortedMap (createCurrent (15 )),
133
- migrations , migrationsOut , " USER" , environment .getTableIdMap ()));
134
+ migrations , migrationsOut , DataLevel . USER . name () , environment .getTableIdMap ()));
134
135
assertEquals (20000 , wait );
135
136
// no more balancing to do
136
137
assertEquals (0 , migrationsOut .size ());
@@ -147,7 +148,7 @@ public void testBalanceWithTooManyOutstandingMigrations() {
147
148
migrations .addAll (tableTablets .get (BAR .getTableName ()));
148
149
long wait =
149
150
this .balance (new BalanceParamsImpl (Collections .unmodifiableSortedMap (createCurrent (15 )),
150
- migrations , migrationsOut , " USER" , environment .getTableIdMap ()));
151
+ migrations , migrationsOut , DataLevel . USER . name () , environment .getTableIdMap ()));
151
152
assertEquals (20000 , wait );
152
153
// no migrations should have occurred as 10 is the maxOutstandingMigrations
153
154
assertEquals (0 , migrationsOut .size ());
@@ -490,12 +491,12 @@ public void testOutOfBoundsTablets() {
490
491
// in the HostRegexTableLoadBalancer. For this test we want
491
492
// to get into the out of bounds checking code, so we need to
492
493
// populate the map with an older time value
493
- this .lastOOBCheckTimes .put (" USER" , System .currentTimeMillis () / 2 );
494
+ this .lastOOBCheckTimes .put (DataLevel . USER . name () , System .currentTimeMillis () / 2 );
494
495
init (DEFAULT_TABLE_PROPERTIES );
495
496
Set <TabletId > migrations = new HashSet <>();
496
497
List <TabletMigration > migrationsOut = new ArrayList <>();
497
- this .balance (new BalanceParamsImpl (createCurrent (15 ), migrations , migrationsOut , "USER" ,
498
- environment .getTableIdMap ()));
498
+ this .balance (new BalanceParamsImpl (createCurrent (15 ), migrations , migrationsOut ,
499
+ DataLevel . USER . name (), environment .getTableIdMap ()));
499
500
assertEquals (2 , migrationsOut .size ());
500
501
}
501
502
0 commit comments