# 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
<a href="speculativeExecution/index.html">speculative execution</a>.</p></div>
        

        
            















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




















        
    
    

    

    

    

    

    

    

    

    
        </div>

## Methods

<div class="jsdoc-content">

        
            

    

    
    <h3 class="name" id=".defaultAddressTranslator"><span class="type-signature">(static) </span>defaultAddressTranslator<span class="signature">()</span><span class="type-signature"> &rarr; {AddressTranslator}</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.6.1/lib/policies/index.js#L25" target="_blank" rel="noopener">policies/index.js, line 25</a></p></div>















<h4>Returns:</h4>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">AddressTranslator</span>


    </dd>
</dl>

    





        
            

    

    
    <h3 class="name" id=".defaultLoadBalancingPolicy"><span class="type-signature">(static) </span>defaultLoadBalancingPolicy<span class="signature">(localDc<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {DefaultLoadBalancingPolicy}</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>Attributes</th>
        

        

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

    <tbody>
    

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

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>When provided, it sets the data center that is going to be used as local for the
load-balancing policy instance, with dc failover disabled.</p>
<p>When localDc is undefined, the load balancing policy will not be data-center aware.</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.6.1/lib/policies/index.js#L37" target="_blank" rel="noopener">policies/index.js, line 37</a></p></div>















<h4>Returns:</h4>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">DefaultLoadBalancingPolicy</span>


    </dd>
</dl>

    





        
            

    

    
    <h3 class="name" id=".defaultReconnectionPolicy"><span class="type-signature">(static) </span>defaultReconnectionPolicy<span class="signature">()</span><span class="type-signature"> &rarr; {ReconnectionPolicy}</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.6.1/lib/policies/index.js#L58" target="_blank" rel="noopener">policies/index.js, line 58</a></p></div>















<h4>Returns:</h4>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">ReconnectionPolicy</span>


    </dd>
</dl>

    





        
            

    

    
    <h3 class="name" id=".defaultRetryPolicy"><span class="type-signature">(static) </span>defaultRetryPolicy<span class="signature">()</span><span class="type-signature"> &rarr; {RetryPolicy}</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.6.1/lib/policies/index.js#L50" target="_blank" rel="noopener">policies/index.js, line 50</a></p></div>















<h4>Returns:</h4>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">RetryPolicy</span>


    </dd>
</dl>

    





        
            

    

    
    <h3 class="name" id=".defaultSpeculativeExecutionPolicy"><span class="type-signature">(static) </span>defaultSpeculativeExecutionPolicy<span class="signature">()</span><span class="type-signature"> &rarr; {SpeculativeExecutionPolicy}</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.6.1/lib/policies/index.js#L70" target="_blank" rel="noopener">policies/index.js, line 70</a></p></div>















<h4>Returns:</h4>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">SpeculativeExecutionPolicy</span>


    </dd>
</dl>

    





        
            

    

    
    <h3 class="name" id=".defaultTimestampGenerator"><span class="type-signature">(static) </span>defaultTimestampGenerator<span class="signature">()</span><span class="type-signature"> &rarr; {TimestampGenerator}</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.6.1/lib/policies/index.js#L78" target="_blank" rel="noopener">policies/index.js, line 78</a></p></div>















<h4>Returns:</h4>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">TimestampGenerator</span>


    </dd>
</dl></div>
