# policies

<div class="jsdoc-content"><header>
    
        
            
        
    
</header>


    
        
            <div class="description"><p>Contains driver tuning policies to determine <a href="loadBalancing/index.html">load balancing</a>,
<a href="retry/index.html">retrying</a> queries, <a href="reconnection/index.html">reconnecting</a> to a node,
<a href="addressResolution/index.html">address resolution</a>,
<a href="timestampGeneration/index.html">timestamp generation</a> and
speculative execution.</p></div>
        

        
            















<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/policies/index.ts#L3" target="_blank" rel="noopener">policies/index.ts, line 3</a></p></div>




















        
    
    

    

    

    

    

    

    

    

    
        </div>

## Methods

<div class="jsdoc-content">

        
            

    

    
    <h3 class="name" id="~defaultAddressTranslator"><span class="type-signature">(inner) </span>defaultAddressTranslator<span class="signature">()</span><span class="type-signature"></span></h3>
    

    



<div class="description">
    <p>Returns a new instance of the default address translator policy used by the driver.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/policies/index.ts#L30" target="_blank" rel="noopener">policies/index.ts, line 30</a></p></div>




















        
            

    

    
    <h3 class="name" id="~defaultLoadBalancingPolicy"><span class="type-signature">(inner) </span>defaultLoadBalancingPolicy<span class="signature">(localDc)</span><span class="type-signature"></span></h3>
    

    



<div class="description">
    <p>Returns a new instance of the default load-balancing policy used by the driver.</p>
</div>









    <h4>Parameters:</h4>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>localDc</code></td>
            

            <td class="type">
            
            </td>

            

            

            <td class="description last"><p>When provided, it explicitly sets the data center that is going to be used as local for the
load-balancing policy instance, with dc failover disabled. This value takes precedence over
<code>ClientOptions.localDataCenter</code>.</p>
<p>When <code>localDc</code> is undefined, null, or empty, the policy has no explicit data-center preference. If the policy is used by a client,
<code>ClientOptions.localDataCenter</code> supplies the fallback preference. The policy is not data-center aware when neither
value is provided.</p></td>
        </tr>

    
    </tbody>
</table>






<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/policies/index.ts#L44" target="_blank" rel="noopener">policies/index.ts, line 44</a></p></div>




















        
            

    

    
    <h3 class="name" id="~defaultReconnectionPolicy"><span class="type-signature">(inner) </span>defaultReconnectionPolicy<span class="signature">()</span><span class="type-signature"></span></h3>
    

    



<div class="description">
    <p>Returns a new instance of the default reconnection policy used by the driver.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/policies/index.ts#L75" target="_blank" rel="noopener">policies/index.ts, line 75</a></p></div>




















        
            

    

    
    <h3 class="name" id="~defaultRetryPolicy"><span class="type-signature">(inner) </span>defaultRetryPolicy<span class="signature">()</span><span class="type-signature"></span></h3>
    

    



<div class="description">
    <p>Returns a new instance of the default retry policy used by the driver.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/policies/index.ts#L68" target="_blank" rel="noopener">policies/index.ts, line 68</a></p></div>




















        
            

    

    
    <h3 class="name" id="~defaultSpeculativeExecutionPolicy"><span class="type-signature">(inner) </span>defaultSpeculativeExecutionPolicy<span class="signature">()</span><span class="type-signature"></span></h3>
    

    



<div class="description">
    <p>Returns a new instance of the default speculative execution policy used by the driver.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/policies/index.ts#L86" target="_blank" rel="noopener">policies/index.ts, line 86</a></p></div>




















        
            

    

    
    <h3 class="name" id="~defaultTimestampGenerator"><span class="type-signature">(inner) </span>defaultTimestampGenerator<span class="signature">()</span><span class="type-signature"></span></h3>
    

    



<div class="description">
    <p>Returns a new instance of the default timestamp generator used by the driver.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.7.1/lib/policies/index.ts#L93" target="_blank" rel="noopener">policies/index.ts, line 93</a></p></div></div>
