id stringlengths 29 30 | content stringlengths 152 2.6k |
|---|---|
codereview_new_java_data_1022 | public void can_do_query_params_and_headers() {
@Test
public void post_with_json_serialization_works() {
JavalinTest.test((server, client) -> {
- server.post("/hello", ctx -> ctx.result(ctx.<MyJavaClass>bodyAsClass(MyJavaClass.class).field1));
Response response = client.post(... |
codereview_new_java_data_1023 | public static void main(String[] args) {
JsonMapper gsonMapper = new JsonMapper() {
@NotNull
@Override
- public String toJsonString(@NotNull Object obj, Type type) {
- return gson.toJson(obj);
}
@NotNull
What is the purpose of th... |
codereview_new_java_data_1028 |
import io.javalin.event.HandlerMetaInfo;
import io.javalin.event.JavalinEvent;
import io.javalin.event.WsHandlerMetaInfo;
-import io.javalin.http.*;
import io.javalin.http.sse.SseClient;
import io.javalin.http.sse.SseHandler;
import io.javalin.jetty.JavalinJettyServlet;
You should configure IntelliJ to not grou... |
codereview_new_java_data_1285 |
-package com.example.fromjava;
-
-class ByteBuffer
-{
- ByteBuffer() {}
- public ByteBuffer get(byte[] dst) { return ByteBuffer(); }
-}
Since you need type resolution anyway, wouldn't it make sense to use the JDK-provided class and method?
|
codereview_new_java_data_1286 |
-package com.example.fromjava;
-
-class ByteBuffer
-{
- ByteBuffer() {}
- public ByteBuffer get(byte[] dst) { return ByteBuffer(); }
-}
```suggestion
public ByteBuffer get(byte[] dst) { return ByteBuffer(); }
```
|
codereview_new_java_data_1617 | private void filter(List<Integer> toShow, List<Integer> toHide, boolean displayS
capability != null && capability.getFilesSharingResharing().isFalse();
OCSpace space = mComponentsGetter.getStorageManager().getSpace(mFiles.get(0).getSpaceId(), mAccount.name);
- boolean notAllowSharing... |
codereview_new_java_data_1622 | public void afterTextChanged(Editable editable) {
fileToUpload.add(filePath);
@NotNull Lazy<TransfersViewModel> transfersViewModelLazy = inject(TransfersViewModel.class);
TransfersViewModel transfersViewModel = transfersViewModelLazy.getValue();
- ... |
codereview_new_java_data_1623 | protected ResultCode doInBackground(Object[] params) {
account.name,
filesToUpload,
uploadPath,
- null
);
uploadFilesFromSystemUseCase.execute(useCaseParams);
fullTempPat... |
codereview_new_java_data_1631 | private boolean anyFileSynchronizingLookingIntoWorkers() {
private boolean anyFileSynchronizingLookingIntoFilesSync() {
boolean synchronizing = false;
- if (!mFiles.isEmpty()) {
for (int i = 0; !synchronizing && i < mFilesSync.size(); i++) {
- for (int j = 0; !synchro... |
codereview_new_java_data_1643 | public void sendDownloadedFile(OCFile ocFile) {
}
}
- public void sendDownloadedFile(List<OCFile> ocFiles) {
if (!ocFiles.isEmpty()) {
Intent sendIntent = makeActionSendIntent(ocFiles);
// Show dialog, without the own app
This one could work
```suggestion
pu... |
codereview_new_java_data_1644 | private boolean onFileActionChosen(int menuId) {
if (!filesAreDown(checkedFiles)) { // Download the file
((FileDisplayActivity) mContainerActivity).startDownloadForSending(checkedFiles.get(0));
} else {
- mContainerActivity.getFileOperationsHel... |
codereview_new_java_data_1717 | public interface ApolloDisposable {
void addListener(Listener listener);
- void removeCancellationListener(Listener listener);
interface Listener {
- void onCancelled();
}
}
Maybe `onDisposed` (or `onDispose`) would make more sense?
public interface ApolloDisposable {
void addListener(Liste... |
codereview_new_java_data_1718 |
public interface ApolloCallback<D extends Operation.Data> {
/**
- * Gets called when GraphQL response is received and parsed successfully. D
*
* @param response the GraphQL response
*/
```suggestion
* Gets called when GraphQL response is received and parsed successfully.
```
public inter... |
codereview_new_java_data_1719 | private NetworkInterceptor(Call.Factory callFactory, String serverUrl) {
@Nullable @Override public MediaType contentType() {
return MediaType.parse(httpRequest.getBody().getContentType());
}
@Override public void writeTo(@NotNull BufferedSink bufferedSink) throws IOExce... |
codereview_new_java_data_3298 | private void checkMemoryMB() {
/** Returns a {@link Sorter} configured with the given {@link Options}. */
public static ExternalSorter create(Options options) {
checkArgument(
- options.getSorterType() == Options.SorterType.NATIVE, "Only Native sorter is supported");
return NativeExternalSorter.... |
codereview_new_java_data_3305 |
import org.apache.beam.sdk.transforms.SerializableFunction;
import org.apache.beam.sdk.transforms.display.DisplayData;
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
-import org.apache.beam.sdk.values.KV;
import org.joda.time.Instant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
unus... |
codereview_new_java_data_3318 | private void advance() {
.mapToObj(i -> new ArrayList<>())
.collect(Collectors.toList());
- // When predicates are applied, a sources containing a key may have no values after filtering.
// Sources containing minKey are by default known to be NONEMPTY. Once all sources are
... |
codereview_new_java_data_3320 | int leastNumBuckets() {
private <V> Map<ResourceId, BucketMetadata<?, ?, V>> fetchMetadata(List<String> directories) {
final int total = directories.size();
- final Map<ResourceId, BucketMetadata<?, ?, V>> md = new ConcurrentHashMap<>();
int start = 0;
while (start < total) {
directories.... |
codereview_new_java_data_3468 | public abstract class PresentationCompiler {
* Returns token informations from presentation compiler.
*
*/
- public abstract CompletableFuture<List<Integer>> semanticTokens(
- VirtualFileParams params,
- List<String> capableTypes,
- List<String> capableModifiers)... |
codereview_new_java_data_3582 | public static void runMain(String[] args) throws Exception {
LoadResult loadResult = load();
if (loadResult.millMainMethod.isPresent()) {
if (!MillEnv.millJvmOptsAlreadyApplied() && MillEnv.millJvmOptsFile().exists()) {
-// System.err.println("Warning: Settings from file `... |
codereview_new_java_data_3663 | public static void execute(String[] args) {
System.out.println(prop);
}
}
- } else if (key.equals("-args")) {
// get all properties
StringBuffer prop = new StringBuffer("");
for (Map.Entry<Object, Object> entry : config.en... |
codereview_new_java_data_3804 |
-package test.flix;
-
-public interface TestInterface {
-}
We have had some trouble with tests depending on Java sources.
Perhaps you could simply use:
- java.lang.Object
- java.io.Serializable
- java.lang.Cloneable
|
codereview_new_java_data_4379 | public boolean pushAggregation(Aggregation aggregation) {
expressions.add((BoundAggregate<?, ?>) bound);
} else {
LOG.info(
- "Skipping aggregate pushdown: AggregateFunc {} can't be converted to iceberg Expression",
aggregateFunc);
return false;
... |
codereview_new_java_data_4380 | public void testSanitizeStringFallback() {
"2022-04-29T23:70:51-07:00",
"2022-04-29T23:49:51.123456+100:00")) {
String sanitizedFilter = ExpressionUtil.toSanitizedString(Expressions.equal("test", filter));
- Assert.assertTrue(
- "Invalid date time string should use defaul... |
codereview_new_java_data_4381 | public boolean canDeleteWhere(Filter[] filters) {
}
private boolean selectsPartitions(Expression expr) {
- return table().specs().values().stream()
- .allMatch(spec -> ExpressionUtil.selectsPartitions(expr, spec, isCaseSensitive()));
}
// a metadata delete is possible iff matching files can b... |
codereview_new_java_data_4384 | private DataFile buildDataFileFromAction(Action action, Table table) {
InputFile file = deltaLakeFileIO.newInputFile(fullFilePath);
if (!file.exists()) {
throw new NotFoundException(
- "The file %s does not exist in the Delta Lake table at %s",
fullFilePath, deltaTableLocation);
... |
codereview_new_java_data_4387 | public class RESTSessionCatalog extends BaseSessionCatalog
implements Configurable<Configuration>, Closeable {
private static final Logger LOG = LoggerFactory.getLogger(RESTSessionCatalog.class);
private static final String REST_METRICS_REPORTING_ENABLED = "rest-metrics-reporting-enabled";
- private static... |
codereview_new_java_data_4389 | public void testDropBranchDoesNotExist() {
}
@Test
- public void testDropBranchFailesForTag() throws NoSuchTableException {
String tagName = "b1";
Table table = insertRows();
table.manageSnapshots().createTag(tagName, table.currentSnapshot().snapshotId()).commit();
```suggestion
public void... |
codereview_new_java_data_4390 | public static Map<Integer, String> indexQuotedNameById(Schema schema) {
}
/**
- * convert partition spec to Spark type
*
- * @param spec
- * @return
*/
public static StructType convert(PartitionSpec spec) {
return convert(new Schema(spec.partitionType().asNestedType().asStructType().field... |
codereview_new_java_data_4391 | public static Map<Integer, String> indexQuotedNameById(Schema schema) {
Function<String, String> quotingFunc = name -> String.format("`%s`", name.replace("`", "``"));
return TypeUtil.indexQuotedNameById(schema.asStruct(), quotingFunc);
}
-
- /**
- * Convert a {@link PartitionSpec} to a {@link DataType ... |
codereview_new_java_data_4392 | public void filter(Filter[] filters) {
.collect(Collectors.toList());
LOG.info(
- "{}/{} tasks for table {} matched runtime file filter",
filteredTasks.size(),
tasks().size(),
- table().name());
resetTasks(filteredTask... |
codereview_new_java_data_4393 | private HttpClientConfigurations loadHttpClientConfigurations(
return httpClientConfigurations;
} catch (NoSuchMethodException e) {
throw new IllegalArgumentException(
- String.format(
- "Cannot initialize HttpClientConfigurations Implementation %s: %s",
- impl, e.... |
codereview_new_java_data_4394 | private HttpClientConfigurations loadHttpClientConfigurations(
return httpClientConfigurations;
} catch (NoSuchMethodException e) {
throw new IllegalArgumentException(
- String.format(
- "Cannot initialize HttpClientConfigurations Implementation %s: %s",
- impl, e.... |
codereview_new_java_data_4396 | private Pair<Table, Long> load(Identifier ident) throws NoSuchTableException {
Preconditions.checkArgument(
tagSnapshot != null, "Cannot find snapshot associated with tag name: %s", tag);
return Pair.of(table, tagSnapshot.snapshotId());
}
-
- return Pair.of(table, null);
}
priv... |
codereview_new_java_data_4397 | private Table loadFromPathIdentifier(PathIdentifier ident) {
Preconditions.checkArgument(
tagSnapshot != null, "Cannot find snapshot associated with tag name: %s", tag);
return new SparkTable(table, tagSnapshot.snapshotId(), !cacheEnabled);
}
-
- return new SparkTable(table, snapshotId... |
codereview_new_java_data_4443 | public void onBindViewHolder(@NonNull Holder holder, int position) {
.fitCenter()
.dontAnimate())
.into(holder.imageView);
-
}
@Nullable
```suggestion
}
```
public void onBindViewHolder(@NonNull Holder holder, int position) {
... |
codereview_new_java_data_4444 | public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMen
recyclerViewFeeds.setLayoutManager(layoutManagerFeeds);
adapterFeeds = new HorizontalFeedListAdapter((MainActivity) getActivity()) {
-
@Override
public void onCreateContextMenu(ContextMenu con... |
codereview_new_java_data_4445 | public MainActivityStarter withAddToBackStack() {
public MainActivityStarter withFragmentLoaded(String fragmentName) {
intent.putExtra(EXTRA_FRAGMENT_TAG, fragmentName);
intent.putExtra(EXTRA_OPEN_DRAWER, true);
return this;
}
These should be two different methods. One that load... |
codereview_new_java_data_4446 | public class DownloadServiceCallbacksImpl implements DownloadServiceCallbacks {
@Override
public PendingIntent getNotificationContentIntent(Context context) {
- Intent intent = new Intent(context, MainActivity.class);
- intent.putExtra(MainActivityStarter.EXTRA_FRAGMENT_TAG, CompletedDownload... |
codereview_new_java_data_4447 | public void onItemClick(int position) {
@Override
public boolean onItemLongClick(int position) {
if (position < navAdapter.getFragmentTags().size()) {
- DrawerPreferencesDialog.show(getContext(), () -> {
- navAdapter.notifyDataSetChanged();
- ... |
codereview_new_java_data_4448 | public static class FeedSettingsPreferenceFragment extends PreferenceFragmentCom
private static final String PREF_FEED_PLAYBACK_SPEED = "feedPlaybackSpeed";
private static final String PREF_AUTO_SKIP = "feedAutoSkip";
private static final String PREF_TAGS = "tags";
- private static fi... |
codereview_new_java_data_4449 | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
emptyView.setIcon(R.drawable.ic_history);
emptyView.setTitle(R.string.no_history_head_label);
emptyView.setMessage(R.string.no_history_label);
- swipeActions = new SwipeActions(this, getFragmentTag()).atta... |
codereview_new_java_data_4450 | public interface SwipeAction {
String TOGGLE_PLAYED = "MARK_PLAYED";
String REMOVE_FROM_QUEUE = "REMOVE_FROM_QUEUE";
String DELETE = "DELETE";
- String REMOVE_FROM_HISTORY = "DELETE";
String getId();
This should be a different constant from actual episode deletion.
public interface SwipeA... |
codereview_new_java_data_4451 | public static Future<?> deleteFromPlaybackHistory(FeedItem feedItem) {
return dbExec.submit(() -> {
PodDBAdapter adapter = PodDBAdapter.getInstance();
adapter.open();
- adapter.removeFromPlaybackHistory(feedItem);
adapter.close();
EventBus.getDefa... |
codereview_new_java_data_4452 | public void performAction(FeedItem item, Fragment fragment, FeedItemFilter filte
DBWriter.deleteFromPlaybackHistory(item);
((MainActivity) fragment.requireActivity())
- .showSnackbarAbovePlayer(
- R.string.removed_history_label,
- Snackba... |
codereview_new_java_data_4453 | public static Future<?> clearPlaybackHistory() {
}
public static Future<?> deleteFromPlaybackHistory(FeedItem feedItem) {
- return dbExec.submit(() -> {
- PodDBAdapter adapter = PodDBAdapter.getInstance();
- adapter.open();
-
- feedItem.getMedia().setPlaybackCompleti... |
codereview_new_java_data_4454 | public synchronized void init() {
}
}
- public boolean isRefresed() {
- return refresed;
- }
-
- public void setRefresed(boolean refresed) {
- this.refresed = refresed;
- }
-
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEventMainThread(PlaybackServiceEvent ... |
codereview_new_java_data_4455 | public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
.setTitle(getString(R.string.chapters_label))
.setView(onCreateView(getLayoutInflater()))
.setPositiveButton(getString(R.string.close_label), null) //dismisses
- .setNeutralButton("Rese... |
codereview_new_java_data_4456 | public boolean onMenuItemClick(MenuItem item) {
ConfirmationDialog conDialog = new ConfirmationDialog(
getActivity(),
- de.danoeh.antennapod.ui.statistics.R.string.clear_playback_history,
- de.danoeh.antennapod.ui.statistics.R.string.clear_playb... |
codereview_new_java_data_4457 | private static void upgrade(int oldVersion, Context context) {
if (feedCounterSetting.equals("0")) {
prefs.edit().putString(UserPreferences.PREF_DRAWER_FEED_COUNTER, "2").apply();
}
- }
- if (oldVersion < 2070095) {
- long value = Long.parseLong(Sle... |
codereview_new_java_data_4458 | private static void upgrade(int oldVersion, Context context) {
if (feedCounterSetting.equals("0")) {
prefs.edit().putString(UserPreferences.PREF_DRAWER_FEED_COUNTER, "2").apply();
}
- }
- if (oldVersion < 2070095) {
- long value = Long.parseLong(Sle... |
codereview_new_java_data_4459 | private static void upgrade(int oldVersion, Context context) {
SharedPreferences sleepTimerPreferences =
context.getSharedPreferences(SleepTimerPreferences.PREF_NAME, Context.MODE_PRIVATE);
- String prefTimeUnit = "LastTimeUnit";
- int defaultTimeUnit = 1;
... |
codereview_new_java_data_4460 | public void testInit() {
private Playable writeTestPlayable(String downloadUrl, String fileUrl) {
Feed f = new Feed(0, null, "f", "l", "d", null, null, null, null, "i", null, null, "l", false);
FeedPreferences prefs = new FeedPreferences(f.getId(), false, FeedPreferences.AutoDeleteAction.NO,
- ... |
codereview_new_java_data_4461 | public void performAction(FeedItem item, Fragment fragment, FeedItemFilter filte
@Override
public boolean willRemove(FeedItemFilter filter, FeedItem item) {
- return filter.showPlayed || filter.showNew;
}
}
I think you need to check based on the item here. Otherwise the items are no longer sw... |
codereview_new_java_data_4462 | public void performAction(FeedItem item, Fragment fragment, FeedItemFilter filte
@Override
public boolean willRemove(FeedItemFilter filter, FeedItem item) {
- if (item.getPlayState() == item.NEW) {
return filter.showPlayed || filter.showNew;
} else {
return filter.... |
codereview_new_java_data_4463 | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
recyclerView.setRecycledViewPool(((MainActivity) getActivity()).getRecycledViewPool());
setupLoadMoreScrollListener();
- swipeActions = new SwipeActions(this, TAG).attachTo(recyclerView);
swipeActions.se... |
codereview_new_java_data_4464 | private static void upgrade(int oldVersion, Context context) {
if (oldVersion < 2050000) {
prefs.edit().putBoolean(UserPreferences.PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS, true).apply();
}
- if (oldVersion < 2070000) {
// Migrate drawer feed counter setting to reflect remo... |
codereview_new_java_data_4465 | public final Map<Long, Integer> getFeedCounters(FeedCounter setting, long... fee
whereRead = KEY_READ + "=" + FeedItem.NEW;
break;
case SHOW_UNPLAYED:
- whereRead = KEY_READ + "=" + FeedItem.UNPLAYED;
break;
case SHOW_DOWNLOADE... |
codereview_new_java_data_4466 | public void statusChanged(PlaybackServiceMediaPlayer.PSMPInfo newInfo) {
break;
}
- // Trigger an update to the Quick Settings tile (see QuickSettingsTileService.java)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- TileService.requestL... |
codereview_new_java_data_4467 | public ClassLoader getClassLoader(String context) {
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
- }).collect(Collectors.toList()).toArray(new URL[] {}), ClassLoader.getSystemClassLoader());
});
}
}
```suggestion
}).toArray(URL[]::new), ClassLo... |
codereview_new_java_data_4468 | public enum Property {
+ " a comma or other reserved characters in a URI use standard URI hex"
+ " encoding. For example replace commas with %2C.",
"1.6.0"),
- INSTANCE_VOLUMES_CONFIG("instance.volume.config.", null, PropertyType.PREFIX,
"Properties in this category are used to pro... |
codereview_new_java_data_4469 | public void createTableWithTableNameLengthLimit()
public void createTableWithBadProperties()
throws AccumuloException, AccumuloSecurityException, TableExistsException {
TableOperations tableOps = accumuloClient.tableOperations();
- String t0 = StringUtils.repeat('a', MAX_TABLE_NAME_LEN - 1);
tab... |
codereview_new_java_data_4470 | public void testCanRun() {
// ensure this fails with older versions; the oldest supported version is hard-coded here
// to ensure we don't unintentionally break upgrade support; changing this should be a conscious
// decision and this check will ensure we don't overlook it
- // as of 3.0 we will only... |
codereview_new_java_data_4471 | public class AccumuloDataVersion {
*
* <ul>
* <li>version (9) RFiles and wal crypto serialization changes. RFile summary data in 2.0.0</li>
- * <li>version (8) RFile index (ACCUMULO-1124) and wal tracking in ZK</li>
* <li>version (7) also reflects the addition of a replication table in 1.7.0
* <l... |
codereview_new_java_data_4472 | public synchronized void upgradeZookeeper(ServerContext context,
int oldestVersion = ROOT_TABLET_META_CHANGES;
if (cv < oldestVersion) {
String oldRelease = dataVersionToReleaseName(oldestVersion);
- throw new UnsupportedOperationException("Upgrading from a version before " + oldRelease
... |
codereview_new_java_data_4473 |
import org.apache.accumulo.core.conf.Property;
/**
- * A {@link VolumeChooser} that selects a volume at random from the list of provided volumes. This
- * class is currently the default volume chooser as set by {@link Property#GENERAL_VOLUME_CHOOSER}.
*
* @since 2.1.0
*/
```suggestion
* A {@link VolumeCho... |
codereview_new_java_data_4474 | public enum Property {
+ " summary data, that is not currently in cache, from RFiles.",
"2.0.0"),
TSERV_LAST_LOCATION_MODE("tserver.last.location.mode", "compact", PropertyType.LAST_LOCATION_MODE,
- "Describes how the system will assign tablets initially by defining how the 'last' location is... |
codereview_new_java_data_4475 | public enum Property {
+ " summary data, that is not currently in cache, from RFiles.",
"2.0.0"),
TSERV_LAST_LOCATION_MODE("tserver.last.location.mode", "compact", PropertyType.LAST_LOCATION_MODE,
- "Describes how the system will assign tablets initially by defining how the 'last' location is... |
codereview_new_java_data_4476 | public enum Property {
+ " summary data, that is not currently in cache, from RFiles.",
"2.0.0"),
TSERV_LAST_LOCATION_MODE("tserver.last.location.mode", "compact", PropertyType.LAST_LOCATION_MODE,
- "Describes how the system will assign tablets initially by defining how the 'last' location is... |
codereview_new_java_data_4477 | public enum Property {
+ " summary data, that is not currently in cache, from RFiles.",
"2.0.0"),
TSERV_LAST_LOCATION_MODE("tserver.last.location.mode", "compact", PropertyType.LAST_LOCATION_MODE,
- "Describes how the system will assign tablets initially by defining how the 'last' location is... |
codereview_new_java_data_4478 | public enum Property {
"Describes how the system will record the 'last' location for tablets, which can be used for assigning them when a cluster restarts."
+ " If 'compaction' is the mode, then the system will record the location where the tablet's most recent compaction occurred."
+ " If... |
codereview_new_java_data_4479 | public static void replaceDatafiles(ServerContext context, KeyExtent extent,
}
TServerInstance self = getTServerInstance(address, zooLock);
- // if the location mode is 'locality'', then preserve the current compaction location in the
// last location value
if ("compaction".equals(context.getC... |
codereview_new_java_data_4480 | public enum PropertyType {
+ "config file using '${env:ACCUMULO_HOME}' or similar."),
ABSOLUTEPATH("absolute path",
- x -> x == null || x.trim().isEmpty() || new Path(x.trim()).isAbsolute()
- || x.equals(Property.CONTEXT_CLASSPATH_PROPERTY.getDefaultValue()),
"An absolute filesyste... |
codereview_new_java_data_4481 | MiniAccumuloConfigImpl initialize() {
// since there is a small amount of memory, check more frequently for majc... setting may not
// be needed in 1.5
mergeProp(Property.TSERV_MAJC_DELAY.getKey(), "3");
- @SuppressWarnings("deprecation")
- Property generalClasspaths = Property.GENERAL_C... |
codereview_new_java_data_4482 | public int numArgs() {
}
public static void printClassPath(PrintWriter writer) {
- try {
- writer.print("Accumulo Shell Classpath: \n");
- final String javaClassPath = System.getProperty("java.class.path");
- if (javaClassPath == null) {
- throw new IllegalStateException("java.class.... |
codereview_new_java_data_4483 | public int numArgs() {
}
public static void printClassPath(PrintWriter writer) {
- try {
- writer.print("Accumulo Shell Classpath: \n");
- final String javaClassPath = System.getProperty("java.class.path");
- if (javaClassPath == null) {
- throw new IllegalStateException("java.class.... |
codereview_new_java_data_4484 | public int numArgs() {
}
public static void printClassPath(PrintWriter writer) {
- try {
- writer.print("Accumulo Shell Classpath: \n");
- final String javaClassPath = System.getProperty("java.class.path");
- if (javaClassPath == null) {
- throw new IllegalStateException("java.class.... |
codereview_new_java_data_4485 | public int numArgs() {
}
public static void printClassPath(PrintWriter writer) {
- try {
- writer.print("Accumulo Shell Classpath: \n");
- final String javaClassPath = System.getProperty("java.class.path");
- if (javaClassPath == null) {
- throw new IllegalStateException("java.class.... |
codereview_new_java_data_4486 | public class BlockCacheManagerFactory {
/**
* Get the BlockCacheFactory specified by the property 'tserver.cache.factory.class' using the
- * configured ContextClassLoaderFactory
*
* @param conf accumulo configuration
* @return block cache manager instance
I think this will now use the system c... |
codereview_new_java_data_4487 | public void compactionSelectorTest() throws Exception {
// data to know if there are too many foos.
PluginConfig csc = new PluginConfig(FooSelector.class.getName());
CompactionConfig compactConfig = new CompactionConfig().setSelector(csc);
- compactionTest(compactConfig);
- }
-
- private void compa... |
codereview_new_java_data_4488 | private static String extractAuthName(ACL acl) {
}
private static boolean canWrite(final Set<String> users, final List<ACL> acls) {
- return ZooDefs.Ids.OPEN_ACL_UNSAFE.equals(acls) || acls.stream()
- .anyMatch(a -> users.contains(extractAuthName(a)) && a.getPerms() >= ZooDefs.Perms.WRITE);
}
... |
codereview_new_java_data_4489 | public static <U> Class<? extends U> loadClass(String className, Class<U> extens
* Retrieve the classloader context from a table's configuration.
*/
public static String tableContext(AccumuloConfiguration conf) {
- return conf.get(conf.resolve(Property.TABLE_CLASSLOADER_CONTEXT));
}
}
You should s... |
codereview_new_java_data_4490 | public Future<?> submit(Runnable task) {
*/
public ScheduledThreadPoolExecutor
createGeneralScheduledExecutorService(AccumuloConfiguration conf) {
- Property prop = conf.resolve(Property.GENERAL_THREADPOOL_SIZE);
- return (ScheduledThreadPoolExecutor) createExecutorService(conf, prop, true);
}
... |
codereview_new_java_data_4491 | public void test() {
TableConfiguration conf = createMock(TableConfiguration.class);
// Eclipse might show @SuppressWarnings("removal") as unnecessary.
// Eclipse is wrong. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=565271
- expect(conf.resolve(Property.TABLE_CLASSLOADER_CONTEXT))
- .an... |
codereview_new_java_data_4492 | public static String prepareBulkImport(ServerContext manager, final VolumeManage
AccumuloConfiguration serverConfig = manager.getConfiguration();
ExecutorService workers = ThreadPools.getServerThreadPools().createExecutorService(serverConfig,
- serverConfig.resolve(Property.MANAGER_RENAME_THREADS), ... |
codereview_new_java_data_4493 | public void removeInUseLogs(Set<DfsLogger> candidates) {
public void checkIfMinorCompactionNeededForLogs(List<DfsLogger> closedLogs) {
// grab this outside of tablet lock.
- Property prop = tableConfiguration.resolve(Property.TSERV_WAL_MAX_REFERENCED);
- int maxLogs = tableConfiguration.getCount(prop);... |
codereview_new_java_data_4494 | public void testVerifyPassword() throws Exception {
assertArrayEquals(password, secretManager.retrievePassword(id));
// Make a second token for the same user
- // Sleep for 1 millisecond to guarantee token is unique
Thread.sleep(100);
Entry<Token<AuthenticationTokenIdentifier>,AuthenticationTo... |
codereview_new_java_data_4495 | public interface InputParameters {
/**
* @return the id of the tablet being compacted
- * @since 2.1.1
*/
TabletId getTabletId();
This is an API addition. It shouldn't be added in a patch release, according to our semver rules.
public interface InputParameters {
/**
* @ret... |
codereview_new_java_data_4496 | Collection<Summary> getSummaries(Collection<CompactableFile> files,
/**
* @return the tablet id of the tablet being compacted
- * @since 2.1.1
*/
TabletId getTabletId();
Also public API. So, same comment here.
Collection<Summary> getSummaries(Collection<CompactableFile> files,
/... |
codereview_new_java_data_4497 | protected FileSKVWriter openWriter(FileOptions options) throws IOException {
}
if (options.dropCacheBehind) {
- // Tell the DataNode that the write ahead log does not need to be cached in the OS page
- // cache
try {
outputStream.setDropBehind(Boolean.TRUE);
LOG.trace("Ca... |
codereview_new_java_data_4498 | public enum Property {
"1.3.5"),
TABLE_ARBITRARY_PROP_PREFIX("table.custom.", null, PropertyType.PREFIX,
"Prefix to be used for user defined arbitrary properties.", "1.7.0"),
- TABLE_MAJC_OUTPUT_DROP_CACHE("table.compaction.major.output.drop.cache", "false",
- PropertyType.BOOLEAN,
- "Setti... |
codereview_new_java_data_4499 | public CachableBuilder fsPath(FileSystem fs, Path dataFile, boolean dropCacheBeh
// cache
try {
is.setDropBehind(Boolean.TRUE);
- } catch (IOException | UnsupportedOperationException e) {
log.debug("setDropBehind not enabled for wal file: {}", dataFile);
... |
codereview_new_java_data_4500 |
* </pre>
*
* <p>
- * If migrating code from Connector to AccumuloClient an important difference to consider is that
- * AccumuloClient is closable and Connector was not. Connector uses static resources and therefore
- * creating them is cheap. AccumuloClient attempts to clean up resources on close, so constantly... |
codereview_new_java_data_4501 |
* </pre>
*
* <p>
- * If migrating code from Connector to AccumuloClient an important difference to consider is that
- * AccumuloClient is closable and Connector was not. Connector uses static resources and therefore
- * creating them is cheap. AccumuloClient attempts to clean up resources on close, so constantly... |
codereview_new_java_data_4502 | public void testEndOfFirstTablet() throws Exception {
verifyData(c, tableName, 333, 333, false);
Map<String,Set<String>> hashes = new HashMap<>();
- hashes.put("0333", new HashSet<>());
- hashes.get("0333").add(h1);
hashes.put("null", new HashSet<>());
verifyMetadata(c, tableNam... |
codereview_new_java_data_4503 | public void testEndOfFirstTablet() throws Exception {
Map<String,Set<String>> hashes = new HashMap<>();
hashes.put("0333", Set.of(h1));
- hashes.put("null", new HashSet<>());
verifyMetadata(c, tableName, hashes);
}
}
```suggestion
hashes.put("null", Set.of());
```
public ... |
codereview_new_java_data_4504 | public int execute(final String fullCommand, final CommandLine cl, final Shell s
}
}
if (configuration != null) {
- var propsToAdd = configuration.entrySet().stream()
- .filter(entry -> Property.isValidTablePropertyKey(entry.getKey()))
- .collect(Collectors.toMap(Entry::getKey, ... |
codereview_new_java_data_4505 | public ZooPropLoader(final ZooReaderWriter zrw, final VersionedPropCodec propCod
Stat stat = new Stat();
byte[] bytes = zrw.getData(propStoreKey.getPath(), propStoreWatcher, stat);
- if (bytes.length == 0) {
return new VersionedProperties();
}
VersionedProperties vProps = pr... |
codereview_new_java_data_4506 | VersionedProperties transform(final PropStoreKey<?> propStoreKey, final Transfor
}
upgradeNodes = convertDeprecatedProps(propStoreKey, upgradeNodes);
- // todo - here
results = writeConverted(propStoreKey, upgradeNodes);
if (results == null) {
Did you mean to leave this here?
Ve... |
codereview_new_java_data_4507 | public void initializeSecurity(TCredentials itw, String rootuser)
Collections.singleton(NamespacePermission.ALTER_NAMESPACE));
namespacePerms.put(Namespace.ACCUMULO.id(),
Collections.singleton(NamespacePermission.ALTER_TABLE));
- namespacePerms.put(Namespace.DEFAULT.id(), Collections.singleto... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 12