code: private com.datastax.driver.core.policies.RetryPolicy getPolicy(RetryPolicy policy, Properties props)
      {
          com.datastax.driver.core.policies.RetryPolicy retryPolicy = null;
  
          String isLoggingRetry = (String) props.get("isLoggingRetry");
  
          switch (policy)
          {
          case DowngradingConsistencyRetryPolicy:
              retryPolicy = DowngradingConsistencyRetryPolicy.INSTANCE;
              break;
  
          case FallthroughRetryPolicy:
              retryPolicy = FallthroughRetryPolicy.INSTANCE;
              break;
  
          case Custom:
              retryPolicy = getCustomRetryPolicy(props);
              break;
  
          default:
              break;
          }
  
          if (retryPolicy != null && Boolean.valueOf(isLoggingRetry))
          {
              retryPolicy = new LoggingRetryPolicy(retryPolicy);
          }
  
          return retryPolicy;
  
      }
docs: Gets the policy.
  
  @param policy
  the policy
  @param props
  the props
  @return the policy
  @throws Exception
  the exception