Remove the mention of ofy in most places (#1872)

There are still some mentions of ofy after this PR, but mostly in places
that would need to be modified later anyway.
This commit is contained in:
Lai Jiang 2022-12-08 20:38:57 -05:00 committed by GitHub
parent 88e3b5da94
commit e93a015451
10 changed files with 5 additions and 37 deletions

View file

@ -9,6 +9,4 @@
<suppress files="[/\\].*[/\\]generated.*[/\\]" checks="."/> <suppress files="[/\\].*[/\\]generated.*[/\\]" checks="."/>
<!-- Ignore Javadoc checks in test files --> <!-- Ignore Javadoc checks in test files -->
<suppress files="[/\\].*[/\\]src/test/java/.*[/\\]" checks="JavadocType"/> <suppress files="[/\\].*[/\\]src/test/java/.*[/\\]" checks="JavadocType"/>
<!-- ofy() regex check doesn't apply to these files -->
<suppress files="AugmentedDeleter.java|AugmentedSaver.java|Ofy.java" checks="RegexpSingleline"/>
</suppressions> </suppressions>

View file

@ -109,15 +109,6 @@ PRESUBMITS = {
"System.(out|err).println is only allowed in tools/ packages. Please " "System.(out|err).println is only allowed in tools/ packages. Please "
"use a logger instead.", "use a logger instead.",
# ObjectifyService.register is restricted to main/ or AppEngineExtension.
PresubmitCheck(
r".*\bObjectifyService\.register", "java", {
"/build/", "/generated/", "node_modules/", "src/main/",
"AppEngineExtension.java"
}):
"ObjectifyService.register(...) is not allowed in tests. Please use "
"AppEngineExtension.register(...) instead.",
# PostgreSQLContainer instantiation must specify docker tag # PostgreSQLContainer instantiation must specify docker tag
# TODO(b/204572437): Fix the pattern to pass DatabaseSnapshotTest.java # TODO(b/204572437): Fix the pattern to pass DatabaseSnapshotTest.java
PresubmitCheck( PresubmitCheck(

View file

@ -1450,11 +1450,6 @@ public final class RegistryConfig {
return CONFIG_SETTINGS.get().registryPolicy.defaultRegistrarWhoisServer; return CONFIG_SETTINGS.get().registryPolicy.defaultRegistrarWhoisServer;
} }
/** Returns the base retry duration that gets doubled after each failure within {@code Ofy}. */
public static Duration getBaseOfyRetryDuration() {
return Duration.millis(CONFIG_SETTINGS.get().datastore.baseOfyRetryMillis);
}
/** Returns the default database transaction isolation. */ /** Returns the default database transaction isolation. */
public static String getHibernateConnectionIsolation() { public static String getHibernateConnectionIsolation() {
return CONFIG_SETTINGS.get().hibernate.connectionIsolation; return CONFIG_SETTINGS.get().hibernate.connectionIsolation;

View file

@ -26,7 +26,6 @@ public class RegistryConfigSettings {
public OAuth oAuth; public OAuth oAuth;
public CredentialOAuth credentialOAuth; public CredentialOAuth credentialOAuth;
public RegistryPolicy registryPolicy; public RegistryPolicy registryPolicy;
public Datastore datastore;
public Hibernate hibernate; public Hibernate hibernate;
public CloudSql cloudSql; public CloudSql cloudSql;
public CloudDns cloudDns; public CloudDns cloudDns;
@ -108,11 +107,6 @@ public class RegistryConfigSettings {
public boolean requireSslCertificates; public boolean requireSslCertificates;
} }
/** Configuration for Cloud Datastore. */
public static class Datastore {
public int baseOfyRetryMillis;
}
/** Configuration for Hibernate. */ /** Configuration for Hibernate. */
public static class Hibernate { public static class Hibernate {
public String connectionIsolation; public String connectionIsolation;

View file

@ -182,11 +182,6 @@ registryPolicy:
# should generally be true for production environments, for added security. # should generally be true for production environments, for added security.
requireSslCertificates: true requireSslCertificates: true
datastore:
# Milliseconds that Objectify waits to retry a Datastore transaction (this
# doubles after each failure).
baseOfyRetryMillis: 100
hibernate: hibernate:
# Make 'SERIALIZABLE' the default isolation level to ensure correctness. # Make 'SERIALIZABLE' the default isolation level to ensure correctness.
# #

View file

@ -10,10 +10,6 @@ registryPolicy:
Disclaimer line 1. Disclaimer line 1.
Line 2 is this 1. Line 2 is this 1.
datastore:
eppResourceIndexBucketsNum: 3
baseOfyRetryMillis: 0
caching: caching:
singletonCacheRefreshSeconds: 0 singletonCacheRefreshSeconds: 0
domainLabelCachingSeconds: 0 domainLabelCachingSeconds: 0

View file

@ -165,8 +165,8 @@ public final class EppResourceUtils {
// UpdateAutoTimestamp. For non-mutating uses (info, whois, etc.), this is equivalent to rolling // UpdateAutoTimestamp. For non-mutating uses (info, whois, etc.), this is equivalent to rolling
// "now" forward to at least the last update on the resource, so that a read right after a write // "now" forward to at least the last update on the resource, so that a read right after a write
// doesn't appear stale. For mutating flows, if we had to roll now forward then the flow will // doesn't appear stale. For mutating flows, if we had to roll now forward then the flow will
// fail when it tries to save anything via Ofy, since "now" is needed to be > the last update // fail when it tries to save anything, since "now" is needed to be > the last update time for
// time for writes. // writes.
return Optional.of( return Optional.of(
cloneProjectedAtTime( cloneProjectedAtTime(
resource, latestOf(now, resource.getUpdateTimestamp().getTimestamp()))); resource, latestOf(now, resource.getUpdateTimestamp().getTimestamp())));

View file

@ -137,7 +137,7 @@ public abstract class HistoryEntry extends ImmutableObject
@Column(name = "historyXmlBytes") @Column(name = "historyXmlBytes")
byte[] xmlBytes; byte[] xmlBytes;
/** The time the command occurred, represented by the ofy transaction time. */ /** The time the command occurred, represented by the transaction time. */
@Column(nullable = false, name = "historyModificationTime") @Column(nullable = false, name = "historyModificationTime")
DateTime modificationTime; DateTime modificationTime;

View file

@ -46,8 +46,8 @@ public final class LordnTaskUtils {
/** Enqueues a task in the LORDN queue representing a line of CSV for LORDN export. */ /** Enqueues a task in the LORDN queue representing a line of CSV for LORDN export. */
public static void enqueueDomainTask(Domain domain) { public static void enqueueDomainTask(Domain domain) {
tm().assertInTransaction(); tm().assertInTransaction();
// This method needs to use ofy transactionTime as the Domain's creationTime because // This method needs to use transactionTime as the Domain's creationTime because CreationTime
// CreationTime isn't yet populated when this method is called during the resource flow. // isn't yet populated when this method is called during the resource flow.
String tld = domain.getTld(); String tld = domain.getTld();
if (domain.getLaunchNotice() == null) { if (domain.getLaunchNotice() == null) {
getQueue(QUEUE_SUNRISE).add(TaskOptions.Builder getQueue(QUEUE_SUNRISE).add(TaskOptions.Builder

View file

@ -45,7 +45,6 @@ public class SetDatabaseMigrationStateCommandTest
assertThat(jpaTm().transact(() -> jpaTm().loadSingleton(DatabaseMigrationStateSchedule.class))) assertThat(jpaTm().transact(() -> jpaTm().loadSingleton(DatabaseMigrationStateSchedule.class)))
.isEmpty(); .isEmpty();
runCommandForced("--migration_schedule=1970-01-01T00:00:00.000Z=DATASTORE_ONLY"); runCommandForced("--migration_schedule=1970-01-01T00:00:00.000Z=DATASTORE_ONLY");
// use a raw ofy call to check what's in the DB
jpaTm() jpaTm()
.transact( .transact(
() -> () ->