Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private static String getAndCheckLegacyLocation(Map<String, String> properties,
if (value != null && DEPRECATED_PROPERTIES.contains(key)) {
throw new IllegalArgumentException(
String.format(
"Property '%s' has been deprecated and will be removed in 2.0, use '%s' instead.",
"Property '%s' has been deprecated and will be removed in 2.0.0, use '%s' instead.",
key, TableProperties.WRITE_DATA_LOCATION));
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/apache/iceberg/MetricsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static MetricsConfig forPositionDelete() {
* Creates a metrics config from table configuration.
*
* @param props table configuration
* @deprecated use {@link MetricsConfig#forTable(Table)}
* @deprecated use {@link MetricsConfig#forTable(Table)}. Will be removed in 2.0.0
*/
@Deprecated
public static MetricsConfig fromProperties(Map<String, String> props) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/apache/iceberg/SystemConfigs.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private SystemConfigs() {}
Integer::parseUnsignedInt);

/**
* @deprecated will be removed in 2.0.0; use name mapping instead
* @deprecated will be removed in 1.12.0; use name mapping instead
*/
@Deprecated
public static final ConfigEntry<Boolean> NETFLIX_UNSAFE_PARQUET_ID_FALLBACK_ENABLED =
Expand All @@ -91,7 +91,7 @@ private SystemConfigs() {}
true,
s -> {
LOG.warn(
"Fallback ID assignment in Parquet is UNSAFE and will be removed in 2.0.0. Use name mapping instead.");
"Fallback ID assignment in Parquet is UNSAFE and will be removed in 1.12.0. Use name mapping instead.");
return Boolean.parseBoolean(s);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* Configuration properties that are controlled by Java system properties.
*
* @deprecated Use {@link SystemConfigs} instead; will be removed in 2.0.0
* @deprecated Use {@link SystemConfigs} instead; will be removed in 1.12.0
*/
@Deprecated
public class SystemProperties {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static Schema pruneColumns(Schema schema, Set<Integer> selectedIds) {
}

/**
* @deprecated will be removed in 2.0.0; use applyNameMapping and pruneColumns(Schema, Set)
* @deprecated will be removed in 1.12.0; use applyNameMapping and pruneColumns(Schema, Set)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did the deprecation removal rules change?
it looks like we considered not ok to remove a public API in a minor update, and now we conclude it's ok.

has this been discussed somewhere already?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a discussion about this in one of the community syncs. The conclusion was that we give guarantees for a whole major version in the api/ module, however in the core/ module we could be less strict and provide guarantees for one minor release. Technically deprecate in the upcoming minor, drop in the one after that is OK in core. Hence, this PR collects all the deprecations in core/ marking removal for 2.0.0 to revisit them and drop earlier if possible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

however in the core/ module we could be less strict and provide guarantees for one minor release

is this written down somewhere so that we can reference the rules of the games when deprecating?
community syncs meeting notes are not normative, we should capture important conclusions somewhere

btw, i don't think this 1 minor release guarantee means much in practice. maven world reality is that minor version update may just happen when combining various artifacts for the final delivery, so removing an API may obviously lead to MethodDefNotFoundError. This may be a fair trade off, i just hope it's a conscious one

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a look, @findepi !
Here are the docs for the api guarantees in different modules. It mentions one minor version guarantee in core module.

* instead.
*/
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static <D> RawDecoder<D> create(
* schema used to decode buffers. The {@code writeSchema} must be the schema that was used to
* encode all buffers decoded by this class.
*
* @deprecated will be removed in 2.0.0; use {@link #create(org.apache.iceberg.Schema, Function,
* @deprecated will be removed in 1.12.0; use {@link #create(org.apache.iceberg.Schema, Function,
* Schema)} instead
*/
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private TransientEncryptionState(KeyManagementClient kmsClient, List<EncryptedKe
private transient volatile SecureRandom lazyRNG = null;

/**
* @deprecated will be removed in 2.0.
* @deprecated will be removed in 1.12.0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC: @ggershinsky - is there any particular reason to keep these to 2.0?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be ok to remove earlier.

*/
@Deprecated
public StandardEncryptionManager(
Expand Down Expand Up @@ -141,7 +141,7 @@ private SecureRandom workerRNG() {
}

/**
* @deprecated will be removed in 2.0.
* @deprecated will be removed in 1.12.0.
*/
@Deprecated
public ByteBuffer wrapKey(ByteBuffer secretKey) {
Expand All @@ -154,7 +154,7 @@ public ByteBuffer wrapKey(ByteBuffer secretKey) {
}

/**
* @deprecated will be removed in 2.0.
* @deprecated will be removed in 1.12.0.
*/
@Deprecated
public ByteBuffer unwrapKey(ByteBuffer wrappedSecretKey) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/apache/iceberg/io/ContentCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void invalidate(String key) {
}

/**
* @deprecated since 1.7.0, will be removed in 2.0.0; This method does only best-effort
* @deprecated since 1.7.0, will be removed in 1.12.0; This method does only best-effort
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is an alternative way to empty the cache?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@findepi Do you know any alternative way to invalidate all entries in the cache?

@pvary we discussed that we may want to leave the targeted removal for 2.0.0. However, this is a functionality we'd like the users to come off (due to the race condition) I think we should remove asap, so 1.12.0 still makes sense to me. WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know any alternative way to invalidate all entries in the cache?

Depends on the goal.
if you invalidate just to reduce memory usage (rare), this method is fine
if you invalidate because something changed and all values needs to be recomputed (including those in flight), then there is no ready to use solution.

In trino we have additional layer on top of Guava caches that solves this problem. Here we use caffeine, but last time i checked, it had the same invalidation race problem and the author's feedback was that it was fundamentally not solvable.
thus, if full invalidation is needed, you can either copy code from trino-cache trino module (or use the code i already extracted https://github.com/findepi/evictable-cache)

Here i'd hope that invalidation isn't really needed for anything and we can remove the API.

* invalidation and is susceptible to a race condition. If the caller changed the state that
* could be cached (perhaps files on the storage) and calls this method, there is no guarantee
* that the cache will not contain stale entries some time after this method returns.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public class RESTSessionCatalog extends BaseViewSessionCatalog
private static final String DEFAULT_FILE_IO_IMPL = "org.apache.iceberg.io.ResolvingFileIO";

/**
* @deprecated will be removed in 2.0.0. Use {@link
* @deprecated will be removed in 1.12.0. Use {@link
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one should be fine to remove before 2.0.0, since the property was only moved to a different class

* org.apache.iceberg.rest.RESTCatalogProperties#PAGE_SIZE} instead.
*/
@Deprecated public static final String REST_PAGE_SIZE = "rest-page-size";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private static Iterable<Long> toIds(Iterable<Snapshot> snapshots) {
}

/**
* @deprecated will be removed in 2.0.0, use {@link #newFilesBetween(Long, long, Function,
* @deprecated will be removed in 1.12.0, use {@link #newFilesBetween(Long, long, Function,
* FileIO)} instead.
*/
@Deprecated
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/org/apache/iceberg/util/ThreadPools.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public class ThreadPools {
private ThreadPools() {}

/**
* @deprecated Use {@link SystemConfigs#WORKER_THREAD_POOL_SIZE WORKER_THREAD_POOL_SIZE} instead;
* will be removed in 2.0.0
* @deprecated Use {@link SystemConfigs#WORKER_THREAD_POOL_SIZE} instead. will be removed in
* 1.12.0
*/
@Deprecated
public static final String WORKER_THREAD_POOL_SIZE_PROP =
Expand Down Expand Up @@ -113,7 +113,7 @@ private static class AuthRefreshPoolHolder {
* either {@link #newExitingWorkerPool(String, int)} or {@link #newFixedThreadPool(String, int)},
* depending on the intended lifecycle of the thread pool.
*
* @deprecated will be removed in 2.0.0. Use {@link #newExitingWorkerPool(String, int)} for
* @deprecated will be removed in 1.12.0. Use {@link #newExitingWorkerPool(String, int)} for
* long-lived thread pools that require a shutdown hook, or {@link #newFixedThreadPool(String,
* int)} for short-lived thread pools where you manage the lifecycle.
*/
Expand All @@ -134,7 +134,7 @@ public static ExecutorService newWorkerPool(String namePrefix) {
* either {@link #newExitingWorkerPool(String, int)} or {@link #newFixedThreadPool(String, int)},
* depending on the intended lifecycle of the thread pool.
*
* @deprecated will be removed in 2.0.0. Use {@link #newExitingWorkerPool(String, int)} for
* @deprecated will be removed in 1.12.0. Use {@link #newExitingWorkerPool(String, int)} for
* long-lived thread pools that require a shutdown hook, or {@link #newFixedThreadPool(String,
* int)} for short-lived thread pools where you manage the lifecycle.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public void testObjectStorageLocationProviderThrowOnDeprecatedProperties() {
assertThatThrownBy(() -> table.locationProvider().newDataLocation("file"))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage(
"Property 'write.folder-storage.path' has been deprecated and will be removed in 2.0, use 'write.data.path' instead.");
"Property 'write.folder-storage.path' has been deprecated and will be removed in 2.0.0, use 'write.data.path' instead.");

table
.updateProperties()
Expand All @@ -230,7 +230,7 @@ public void testObjectStorageLocationProviderThrowOnDeprecatedProperties() {
assertThatThrownBy(() -> table.locationProvider().newDataLocation("file"))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage(
"Property 'write.object-storage.path' has been deprecated and will be removed in 2.0, use 'write.data.path' instead.");
"Property 'write.object-storage.path' has been deprecated and will be removed in 2.0.0, use 'write.data.path' instead.");
}

@TestTemplate
Expand All @@ -245,7 +245,7 @@ public void testDefaultStorageLocationProviderThrowOnDeprecatedProperties() {
assertThatThrownBy(() -> table.locationProvider().newDataLocation("file"))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage(
"Property 'write.folder-storage.path' has been deprecated and will be removed in 2.0, use 'write.data.path' instead.");
"Property 'write.folder-storage.path' has been deprecated and will be removed in 2.0.0, use 'write.data.path' instead.");
}

@TestTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,8 @@ public void setAsciiStream(int parameterIndex, InputStream x, int length) throws
delegate.setAsciiStream(parameterIndex, x, length);
}

@Deprecated(since = "1.2")
// This is deprecated in JDK, we have to remove it once removed there.
@SuppressWarnings("deprecation")
@Override
public void setUnicodeStream(int parameterIndex, InputStream inputStream, int length)
throws SQLException {
Expand Down