- 
                Notifications
    
You must be signed in to change notification settings  - Fork 136
 
feat: introduce java.time variables and methods #3495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
439e105
              fafe22a
              b421084
              ea066d9
              7b77a79
              ade9220
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -24,7 +24,6 @@ | |
| import java.util.ArrayList; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import org.threeten.bp.Duration; | ||
| 
     | 
||
| @InternalApi | ||
| public class CompositeTracer extends BaseApiTracer { | ||
| 
          
            
          
           | 
    @@ -109,7 +108,7 @@ public void attemptCancelled() { | |
| } | ||
| 
     | 
||
| @Override | ||
| public void attemptFailed(Throwable error, Duration delay) { | ||
| public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) { | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Can we import  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done  | 
||
| for (ApiTracer child : children) { | ||
| child.attemptFailed(error, delay); | ||
| } | ||
| 
          
            
          
           | 
    ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -275,7 +275,7 @@ public void onSessionCreateFailure(Throwable t, int createFailureForSessionCount | |
| 
     | 
||
| private static void maybeWaitForSessionCreation( | ||
| SessionPoolOptions sessionPoolOptions, ApiFuture<SessionReference> future) { | ||
| org.threeten.bp.Duration waitDuration = sessionPoolOptions.getWaitForMinSessions(); | ||
| java.time.Duration waitDuration = sessionPoolOptions.getWaitForMinSessions(); | ||
                
       | 
||
| if (waitDuration != null && !waitDuration.isZero()) { | ||
| long timeoutMillis = waitDuration.toMillis(); | ||
| try { | ||
| 
          
            
          
           | 
    ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -16,6 +16,9 @@ | |
| 
     | 
||
| package com.google.cloud.spanner; | ||
| 
     | 
||
| import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; | ||
| 
     | 
||
| import com.google.api.core.ObsoleteApi; | ||
| import com.google.api.gax.tracing.ApiTracer; | ||
| import com.google.api.gax.tracing.ApiTracerFactory.OperationType; | ||
| import com.google.common.base.Preconditions; | ||
| 
        
          
        
         | 
    @@ -27,7 +30,6 @@ | |
| import java.util.concurrent.atomic.AtomicLong; | ||
| import javax.annotation.Nonnull; | ||
| import javax.annotation.Nullable; | ||
| import org.threeten.bp.Duration; | ||
| 
     | 
||
| /** | ||
| * {@link com.google.api.gax.tracing.ApiTracer} for use with OpenTelemetry. Based on {@link | ||
| 
          
            
          
           | 
    @@ -163,8 +165,18 @@ public void attemptCancelled() { | |
| lastConnectionId = null; | ||
| } | ||
| 
     | 
||
| /** | ||
| * This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)} | ||
| * instead. | ||
| */ | ||
| @Override | ||
| @ObsoleteApi("Use attemptFailedDuration(Throwable, java.time.Duration) instead") | ||
| public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) { | ||
| attemptFailedDuration(error, toJavaTimeDuration(delay)); | ||
| } | ||
| 
     | 
||
| @Override | ||
| public void attemptFailed(Throwable error, Duration delay) { | ||
| public void attemptFailedDuration(Throwable error, java.time.Duration delay) { | ||
                
       | 
||
| AttributesBuilder builder = baseAttemptAttributesBuilder(); | ||
| if (delay != null) { | ||
| builder.put(RETRY_DELAY_KEY, delay.toMillis()); | ||
| 
          
            
          
           | 
    ||
Uh oh!
There was an error while loading. Please reload this page.