helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1412308 [35/42] - in /incubator/helix/site-content: ./ apidocs/assets/ apidocs/reference/ apidocs/reference/org/apache/helix/ apidocs/reference/org/apache/helix/alerts/ apidocs/reference/org/apache/helix/controller/ apidocs/reference/org/a...
Date Wed, 21 Nov 2012 21:30:26 GMT
Modified: incubator/helix/site-content/xref/org/apache/helix/manager/zk/ZKHelixDataAccessor.html
URL: http://svn.apache.org/viewvc/incubator/helix/site-content/xref/org/apache/helix/manager/zk/ZKHelixDataAccessor.html?rev=1412308&r1=1412307&r2=1412308&view=diff
==============================================================================
--- incubator/helix/site-content/xref/org/apache/helix/manager/zk/ZKHelixDataAccessor.html
(original)
+++ incubator/helix/site-content/xref/org/apache/helix/manager/zk/ZKHelixDataAccessor.html
Wed Nov 21 21:29:07 2012
@@ -46,15 +46,15 @@
 <a class="jxr_linenumber" name="36" href="#36">36</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.InstanceType;
 <a class="jxr_linenumber" name="37" href="#37">37</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.NotificationContext;
 <a class="jxr_linenumber" name="38" href="#38">38</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.PropertyKey;
-<a class="jxr_linenumber" name="39" href="#39">39</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.PropertyType;
-<a class="jxr_linenumber" name="40" href="#40">40</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.ZNRecord;
-<a class="jxr_linenumber" name="41" href="#41">41</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.ZNRecordAssembler;
-<a class="jxr_linenumber" name="42" href="#42">42</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.ZNRecordBucketizer;
-<a class="jxr_linenumber" name="43" href="#43">43</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.ZNRecordUpdater;
-<a class="jxr_linenumber" name="44" href="#44">44</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.PropertyKey.Builder;
+<a class="jxr_linenumber" name="39" href="#39">39</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.PropertyKey.Builder;
+<a class="jxr_linenumber" name="40" href="#40">40</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.PropertyType;
+<a class="jxr_linenumber" name="41" href="#41">41</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.ZNRecord;
+<a class="jxr_linenumber" name="42" href="#42">42</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.ZNRecordAssembler;
+<a class="jxr_linenumber" name="43" href="#43">43</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.ZNRecordBucketizer;
+<a class="jxr_linenumber" name="44" href="#44">44</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.ZNRecordUpdater;
 <a class="jxr_linenumber" name="45" href="#45">45</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.controller.restlet.ZNRecordUpdate;
-<a class="jxr_linenumber" name="46" href="#46">46</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.controller.restlet.ZkPropertyTransferClient;
-<a class="jxr_linenumber" name="47" href="#47">47</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.controller.restlet.ZNRecordUpdate.OpCode;
+<a class="jxr_linenumber" name="46" href="#46">46</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.controller.restlet.ZNRecordUpdate.OpCode;
+<a class="jxr_linenumber" name="47" href="#47">47</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.controller.restlet.ZkPropertyTransferClient;
 <a class="jxr_linenumber" name="48" href="#48">48</a>  <strong class="jxr_keyword">import</strong>
org.apache.helix.model.LiveInstance;
 <a class="jxr_linenumber" name="49" href="#49">49</a>  <strong class="jxr_keyword">import</strong>
org.apache.log4j.Logger;
 <a class="jxr_linenumber" name="50" href="#50">50</a>  <strong class="jxr_keyword">import</strong>
org.apache.zookeeper.data.Stat;
@@ -508,114 +508,116 @@
 <a class="jxr_linenumber" name="498" href="#498">498</a>         }
 <a class="jxr_linenumber" name="499" href="#499">499</a>         <strong class="jxr_keyword">else</strong>
 <a class="jxr_linenumber" name="500" href="#500">500</a>         {
-<a class="jxr_linenumber" name="501" href="#501">501</a>           <a href="../../../../../org/apache/helix/ZNRecord.html">ZNRecord</a>
metaRecord = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/helix/ZNRecord.html">ZNRecord</a>(value.getId());
-<a class="jxr_linenumber" name="502" href="#502">502</a>           metaRecord.setSimpleFields(value.getRecord().getSimpleFields());
-<a class="jxr_linenumber" name="503" href="#503">503</a>           records.add(metaRecord);
-<a class="jxr_linenumber" name="504" href="#504">504</a> 
-<a class="jxr_linenumber" name="505" href="#505">505</a>           <a href="../../../../../org/apache/helix/ZNRecordBucketizer.html">ZNRecordBucketizer</a>
bucketizer = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/helix/ZNRecordBucketizer.html">ZNRecordBucketizer</a>(value.getBucketSize());
+<a class="jxr_linenumber" name="501" href="#501">501</a>           _baseDataAccessor.remove(path,
options);
+<a class="jxr_linenumber" name="502" href="#502">502</a> 
+<a class="jxr_linenumber" name="503" href="#503">503</a>           <a href="../../../../../org/apache/helix/ZNRecord.html">ZNRecord</a>
metaRecord = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/helix/ZNRecord.html">ZNRecord</a>(value.getId());
+<a class="jxr_linenumber" name="504" href="#504">504</a>           metaRecord.setSimpleFields(value.getRecord().getSimpleFields());
+<a class="jxr_linenumber" name="505" href="#505">505</a>           records.add(metaRecord);
 <a class="jxr_linenumber" name="506" href="#506">506</a> 
-<a class="jxr_linenumber" name="507" href="#507">507</a>           Map&lt;String,
ZNRecord&gt; map = bucketizer.bucketize(value.getRecord());
-<a class="jxr_linenumber" name="508" href="#508">508</a>           List&lt;String&gt;
childBucketizedPaths = <strong class="jxr_keyword">new</strong> ArrayList&lt;String&gt;();
-<a class="jxr_linenumber" name="509" href="#509">509</a>           List&lt;ZNRecord&gt;
childBucketizedRecords = <strong class="jxr_keyword">new</strong> ArrayList&lt;ZNRecord&gt;();
-<a class="jxr_linenumber" name="510" href="#510">510</a>           <strong
class="jxr_keyword">for</strong> (String bucketName : map.keySet())
-<a class="jxr_linenumber" name="511" href="#511">511</a>           {
-<a class="jxr_linenumber" name="512" href="#512">512</a>             childBucketizedPaths.add(path
+ <span class="jxr_string">"/"</span> + bucketName);
-<a class="jxr_linenumber" name="513" href="#513">513</a>             childBucketizedRecords.add(map.get(bucketName));
-<a class="jxr_linenumber" name="514" href="#514">514</a>           }
-<a class="jxr_linenumber" name="515" href="#515">515</a>           bucketizedPaths.set(i,
childBucketizedPaths);
-<a class="jxr_linenumber" name="516" href="#516">516</a>           bucketizedRecords.set(i,
childBucketizedRecords);
-<a class="jxr_linenumber" name="517" href="#517">517</a>         }
-<a class="jxr_linenumber" name="518" href="#518">518</a>         <strong class="jxr_keyword">break</strong>;
-<a class="jxr_linenumber" name="519" href="#519">519</a>       <strong class="jxr_keyword">default</strong>:
-<a class="jxr_linenumber" name="520" href="#520">520</a>         records.add(value.getRecord());
-<a class="jxr_linenumber" name="521" href="#521">521</a>         <strong class="jxr_keyword">break</strong>;
-<a class="jxr_linenumber" name="522" href="#522">522</a>       }
-<a class="jxr_linenumber" name="523" href="#523">523</a>     }
-<a class="jxr_linenumber" name="524" href="#524">524</a> 
-<a class="jxr_linenumber" name="525" href="#525">525</a>     <em class="jxr_comment">//
set non-bucketized nodes or parent nodes of bucketized nodes</em>
-<a class="jxr_linenumber" name="526" href="#526">526</a>     <strong class="jxr_keyword">boolean</strong>
success[] = _baseDataAccessor.setChildren(paths, records, options);
-<a class="jxr_linenumber" name="527" href="#527">527</a> 
-<a class="jxr_linenumber" name="528" href="#528">528</a>     <em class="jxr_comment">//
set bucketized nodes</em>
-<a class="jxr_linenumber" name="529" href="#529">529</a>     List&lt;String&gt;
allBucketizedPaths = <strong class="jxr_keyword">new</strong> ArrayList&lt;String&gt;();
-<a class="jxr_linenumber" name="530" href="#530">530</a>     List&lt;ZNRecord&gt;
allBucketizedRecords = <strong class="jxr_keyword">new</strong> ArrayList&lt;ZNRecord&gt;();
-<a class="jxr_linenumber" name="531" href="#531">531</a> 
-<a class="jxr_linenumber" name="532" href="#532">532</a>     <strong class="jxr_keyword">for</strong>
(<strong class="jxr_keyword">int</strong> i = 0; i &lt; keys.size(); i++)
-<a class="jxr_linenumber" name="533" href="#533">533</a>     {
-<a class="jxr_linenumber" name="534" href="#534">534</a>       <strong class="jxr_keyword">if</strong>
(success[i] &amp;&amp; bucketizedPaths.get(i) != <strong class="jxr_keyword">null</strong>)
-<a class="jxr_linenumber" name="535" href="#535">535</a>       {
-<a class="jxr_linenumber" name="536" href="#536">536</a>         allBucketizedPaths.addAll(bucketizedPaths.get(i));
-<a class="jxr_linenumber" name="537" href="#537">537</a>         allBucketizedRecords.addAll(bucketizedRecords.get(i));
-<a class="jxr_linenumber" name="538" href="#538">538</a>       }
-<a class="jxr_linenumber" name="539" href="#539">539</a>     }
-<a class="jxr_linenumber" name="540" href="#540">540</a> 
-<a class="jxr_linenumber" name="541" href="#541">541</a>     <em class="jxr_comment">//
TODO: set success accordingly</em>
-<a class="jxr_linenumber" name="542" href="#542">542</a>     _baseDataAccessor.setChildren(allBucketizedPaths,
allBucketizedRecords, options);
-<a class="jxr_linenumber" name="543" href="#543">543</a> 
-<a class="jxr_linenumber" name="544" href="#544">544</a>     <strong class="jxr_keyword">return</strong>
success;
-<a class="jxr_linenumber" name="545" href="#545">545</a>   }
-<a class="jxr_linenumber" name="546" href="#546">546</a> 
-<a class="jxr_linenumber" name="547" href="#547">547</a>   @Override
-<a class="jxr_linenumber" name="548" href="#548">548</a>   <strong class="jxr_keyword">public</strong>
BaseDataAccessor&lt;ZNRecord&gt; getBaseDataAccessor()
-<a class="jxr_linenumber" name="549" href="#549">549</a>   {
-<a class="jxr_linenumber" name="550" href="#550">550</a>     <strong class="jxr_keyword">return</strong>
_baseDataAccessor;
-<a class="jxr_linenumber" name="551" href="#551">551</a>   }
-<a class="jxr_linenumber" name="552" href="#552">552</a> 
-<a class="jxr_linenumber" name="553" href="#553">553</a>   @Override
-<a class="jxr_linenumber" name="554" href="#554">554</a>   <strong class="jxr_keyword">public</strong>
&lt;T <strong class="jxr_keyword">extends</strong> HelixProperty&gt; <strong
class="jxr_keyword">boolean</strong>[] updateChildren(List&lt;String&gt;
paths,
-<a class="jxr_linenumber" name="555" href="#555">555</a>                    
                                        List&lt;DataUpdater&lt;ZNRecord&gt;&gt;
updaters,
-<a class="jxr_linenumber" name="556" href="#556">556</a>                    
                                        <strong class="jxr_keyword">int</strong>
options)
-<a class="jxr_linenumber" name="557" href="#557">557</a>   {
-<a class="jxr_linenumber" name="558" href="#558">558</a>     <strong class="jxr_keyword">return</strong>
_baseDataAccessor.updateChildren(paths, updaters, options);
-<a class="jxr_linenumber" name="559" href="#559">559</a>   }
-<a class="jxr_linenumber" name="560" href="#560">560</a> 
-<a class="jxr_linenumber" name="561" href="#561">561</a>   <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> shutdown()
-<a class="jxr_linenumber" name="562" href="#562">562</a>   {
-<a class="jxr_linenumber" name="563" href="#563">563</a>     <strong class="jxr_keyword">if</strong>
(_zkPropertyTransferClient != <strong class="jxr_keyword">null</strong>)
-<a class="jxr_linenumber" name="564" href="#564">564</a>     {
-<a class="jxr_linenumber" name="565" href="#565">565</a>       _zkPropertyTransferClient.shutdown();
-<a class="jxr_linenumber" name="566" href="#566">566</a>     }
-<a class="jxr_linenumber" name="567" href="#567">567</a>   }
-<a class="jxr_linenumber" name="568" href="#568">568</a> 
-<a class="jxr_linenumber" name="569" href="#569">569</a>   @Override
-<a class="jxr_linenumber" name="570" href="#570">570</a>   <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> onControllerChange(<a href="../../../../../org/apache/helix/NotificationContext.html">NotificationContext</a>
changeContext)
-<a class="jxr_linenumber" name="571" href="#571">571</a>   {
-<a class="jxr_linenumber" name="572" href="#572">572</a>     LOG.info(<span
class="jxr_string">"Controller has changed"</span>);
-<a class="jxr_linenumber" name="573" href="#573">573</a>     refreshZkPropertyTransferUrl();
-<a class="jxr_linenumber" name="574" href="#574">574</a>     <strong class="jxr_keyword">if</strong>
(_zkPropertyTransferClient == <strong class="jxr_keyword">null</strong>)
-<a class="jxr_linenumber" name="575" href="#575">575</a>     {
-<a class="jxr_linenumber" name="576" href="#576">576</a>       <strong class="jxr_keyword">if</strong>
(_zkPropertyTransferSvcUrl != <strong class="jxr_keyword">null</strong> &amp;&amp;
_zkPropertyTransferSvcUrl.length() &gt; 0)
-<a class="jxr_linenumber" name="577" href="#577">577</a>       {
-<a class="jxr_linenumber" name="578" href="#578">578</a>         LOG.info(<span
class="jxr_string">"Creating ZkPropertyTransferClient as we get url "</span>
-<a class="jxr_linenumber" name="579" href="#579">579</a>             + _zkPropertyTransferSvcUrl);
-<a class="jxr_linenumber" name="580" href="#580">580</a>         _zkPropertyTransferClient
=
-<a class="jxr_linenumber" name="581" href="#581">581</a>             <strong
class="jxr_keyword">new</strong> <a href="../../../../../org/apache/helix/controller/restlet/ZkPropertyTransferClient.html">ZkPropertyTransferClient</a>(ZkPropertyTransferClient.DEFAULT_MAX_CONCURRENTTASKS);
-<a class="jxr_linenumber" name="582" href="#582">582</a>       }
-<a class="jxr_linenumber" name="583" href="#583">583</a>     }
-<a class="jxr_linenumber" name="584" href="#584">584</a>   }
-<a class="jxr_linenumber" name="585" href="#585">585</a> 
-<a class="jxr_linenumber" name="586" href="#586">586</a>   <strong class="jxr_keyword">void</strong>
refreshZkPropertyTransferUrl()
-<a class="jxr_linenumber" name="587" href="#587">587</a>   {
-<a class="jxr_linenumber" name="588" href="#588">588</a>     <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="589" href="#589">589</a>     {
-<a class="jxr_linenumber" name="590" href="#590">590</a>       <a href="../../../../../org/apache/helix/model/LiveInstance.html">LiveInstance</a>
leader = getProperty(keyBuilder().controllerLeader());
-<a class="jxr_linenumber" name="591" href="#591">591</a>       <strong class="jxr_keyword">if</strong>
(leader != <strong class="jxr_keyword">null</strong>)
-<a class="jxr_linenumber" name="592" href="#592">592</a>       {
-<a class="jxr_linenumber" name="593" href="#593">593</a>         _zkPropertyTransferSvcUrl
= leader.getWebserviceUrl();
-<a class="jxr_linenumber" name="594" href="#594">594</a>         LOG.info(<span
class="jxr_string">"_zkPropertyTransferSvcUrl : "</span> + _zkPropertyTransferSvcUrl
-<a class="jxr_linenumber" name="595" href="#595">595</a>             + <span
class="jxr_string">" Controller "</span> + leader.getInstanceName());
-<a class="jxr_linenumber" name="596" href="#596">596</a>       }
-<a class="jxr_linenumber" name="597" href="#597">597</a>       <strong class="jxr_keyword">else</strong>
-<a class="jxr_linenumber" name="598" href="#598">598</a>       {
-<a class="jxr_linenumber" name="599" href="#599">599</a>         _zkPropertyTransferSvcUrl
= <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="600" href="#600">600</a>       }
-<a class="jxr_linenumber" name="601" href="#601">601</a>     }
-<a class="jxr_linenumber" name="602" href="#602">602</a>     <strong class="jxr_keyword">catch</strong>
(Exception e)
-<a class="jxr_linenumber" name="603" href="#603">603</a>     {
-<a class="jxr_linenumber" name="604" href="#604">604</a>       <em class="jxr_comment">//
LOG.error("", e);</em>
-<a class="jxr_linenumber" name="605" href="#605">605</a>       _zkPropertyTransferSvcUrl
= <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="606" href="#606">606</a>     }
-<a class="jxr_linenumber" name="607" href="#607">607</a>   }
-<a class="jxr_linenumber" name="608" href="#608">608</a> }
+<a class="jxr_linenumber" name="507" href="#507">507</a>           <a href="../../../../../org/apache/helix/ZNRecordBucketizer.html">ZNRecordBucketizer</a>
bucketizer = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/helix/ZNRecordBucketizer.html">ZNRecordBucketizer</a>(value.getBucketSize());
+<a class="jxr_linenumber" name="508" href="#508">508</a> 
+<a class="jxr_linenumber" name="509" href="#509">509</a>           Map&lt;String,
ZNRecord&gt; map = bucketizer.bucketize(value.getRecord());
+<a class="jxr_linenumber" name="510" href="#510">510</a>           List&lt;String&gt;
childBucketizedPaths = <strong class="jxr_keyword">new</strong> ArrayList&lt;String&gt;();
+<a class="jxr_linenumber" name="511" href="#511">511</a>           List&lt;ZNRecord&gt;
childBucketizedRecords = <strong class="jxr_keyword">new</strong> ArrayList&lt;ZNRecord&gt;();
+<a class="jxr_linenumber" name="512" href="#512">512</a>           <strong
class="jxr_keyword">for</strong> (String bucketName : map.keySet())
+<a class="jxr_linenumber" name="513" href="#513">513</a>           {
+<a class="jxr_linenumber" name="514" href="#514">514</a>             childBucketizedPaths.add(path
+ <span class="jxr_string">"/"</span> + bucketName);
+<a class="jxr_linenumber" name="515" href="#515">515</a>             childBucketizedRecords.add(map.get(bucketName));
+<a class="jxr_linenumber" name="516" href="#516">516</a>           }
+<a class="jxr_linenumber" name="517" href="#517">517</a>           bucketizedPaths.set(i,
childBucketizedPaths);
+<a class="jxr_linenumber" name="518" href="#518">518</a>           bucketizedRecords.set(i,
childBucketizedRecords);
+<a class="jxr_linenumber" name="519" href="#519">519</a>         }
+<a class="jxr_linenumber" name="520" href="#520">520</a>         <strong class="jxr_keyword">break</strong>;
+<a class="jxr_linenumber" name="521" href="#521">521</a>       <strong class="jxr_keyword">default</strong>:
+<a class="jxr_linenumber" name="522" href="#522">522</a>         records.add(value.getRecord());
+<a class="jxr_linenumber" name="523" href="#523">523</a>         <strong class="jxr_keyword">break</strong>;
+<a class="jxr_linenumber" name="524" href="#524">524</a>       }
+<a class="jxr_linenumber" name="525" href="#525">525</a>     }
+<a class="jxr_linenumber" name="526" href="#526">526</a> 
+<a class="jxr_linenumber" name="527" href="#527">527</a>     <em class="jxr_comment">//
set non-bucketized nodes or parent nodes of bucketized nodes</em>
+<a class="jxr_linenumber" name="528" href="#528">528</a>     <strong class="jxr_keyword">boolean</strong>
success[] = _baseDataAccessor.setChildren(paths, records, options);
+<a class="jxr_linenumber" name="529" href="#529">529</a> 
+<a class="jxr_linenumber" name="530" href="#530">530</a>     <em class="jxr_comment">//
set bucketized nodes</em>
+<a class="jxr_linenumber" name="531" href="#531">531</a>     List&lt;String&gt;
allBucketizedPaths = <strong class="jxr_keyword">new</strong> ArrayList&lt;String&gt;();
+<a class="jxr_linenumber" name="532" href="#532">532</a>     List&lt;ZNRecord&gt;
allBucketizedRecords = <strong class="jxr_keyword">new</strong> ArrayList&lt;ZNRecord&gt;();
+<a class="jxr_linenumber" name="533" href="#533">533</a> 
+<a class="jxr_linenumber" name="534" href="#534">534</a>     <strong class="jxr_keyword">for</strong>
(<strong class="jxr_keyword">int</strong> i = 0; i &lt; keys.size(); i++)
+<a class="jxr_linenumber" name="535" href="#535">535</a>     {
+<a class="jxr_linenumber" name="536" href="#536">536</a>       <strong class="jxr_keyword">if</strong>
(success[i] &amp;&amp; bucketizedPaths.get(i) != <strong class="jxr_keyword">null</strong>)
+<a class="jxr_linenumber" name="537" href="#537">537</a>       {
+<a class="jxr_linenumber" name="538" href="#538">538</a>         allBucketizedPaths.addAll(bucketizedPaths.get(i));
+<a class="jxr_linenumber" name="539" href="#539">539</a>         allBucketizedRecords.addAll(bucketizedRecords.get(i));
+<a class="jxr_linenumber" name="540" href="#540">540</a>       }
+<a class="jxr_linenumber" name="541" href="#541">541</a>     }
+<a class="jxr_linenumber" name="542" href="#542">542</a> 
+<a class="jxr_linenumber" name="543" href="#543">543</a>     <em class="jxr_comment">//
TODO: set success accordingly</em>
+<a class="jxr_linenumber" name="544" href="#544">544</a>     _baseDataAccessor.setChildren(allBucketizedPaths,
allBucketizedRecords, options);
+<a class="jxr_linenumber" name="545" href="#545">545</a> 
+<a class="jxr_linenumber" name="546" href="#546">546</a>     <strong class="jxr_keyword">return</strong>
success;
+<a class="jxr_linenumber" name="547" href="#547">547</a>   }
+<a class="jxr_linenumber" name="548" href="#548">548</a> 
+<a class="jxr_linenumber" name="549" href="#549">549</a>   @Override
+<a class="jxr_linenumber" name="550" href="#550">550</a>   <strong class="jxr_keyword">public</strong>
BaseDataAccessor&lt;ZNRecord&gt; getBaseDataAccessor()
+<a class="jxr_linenumber" name="551" href="#551">551</a>   {
+<a class="jxr_linenumber" name="552" href="#552">552</a>     <strong class="jxr_keyword">return</strong>
_baseDataAccessor;
+<a class="jxr_linenumber" name="553" href="#553">553</a>   }
+<a class="jxr_linenumber" name="554" href="#554">554</a> 
+<a class="jxr_linenumber" name="555" href="#555">555</a>   @Override
+<a class="jxr_linenumber" name="556" href="#556">556</a>   <strong class="jxr_keyword">public</strong>
&lt;T <strong class="jxr_keyword">extends</strong> HelixProperty&gt; <strong
class="jxr_keyword">boolean</strong>[] updateChildren(List&lt;String&gt;
paths,
+<a class="jxr_linenumber" name="557" href="#557">557</a>                    
                                        List&lt;DataUpdater&lt;ZNRecord&gt;&gt;
updaters,
+<a class="jxr_linenumber" name="558" href="#558">558</a>                    
                                        <strong class="jxr_keyword">int</strong>
options)
+<a class="jxr_linenumber" name="559" href="#559">559</a>   {
+<a class="jxr_linenumber" name="560" href="#560">560</a>     <strong class="jxr_keyword">return</strong>
_baseDataAccessor.updateChildren(paths, updaters, options);
+<a class="jxr_linenumber" name="561" href="#561">561</a>   }
+<a class="jxr_linenumber" name="562" href="#562">562</a> 
+<a class="jxr_linenumber" name="563" href="#563">563</a>   <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> shutdown()
+<a class="jxr_linenumber" name="564" href="#564">564</a>   {
+<a class="jxr_linenumber" name="565" href="#565">565</a>     <strong class="jxr_keyword">if</strong>
(_zkPropertyTransferClient != <strong class="jxr_keyword">null</strong>)
+<a class="jxr_linenumber" name="566" href="#566">566</a>     {
+<a class="jxr_linenumber" name="567" href="#567">567</a>       _zkPropertyTransferClient.shutdown();
+<a class="jxr_linenumber" name="568" href="#568">568</a>     }
+<a class="jxr_linenumber" name="569" href="#569">569</a>   }
+<a class="jxr_linenumber" name="570" href="#570">570</a> 
+<a class="jxr_linenumber" name="571" href="#571">571</a>   @Override
+<a class="jxr_linenumber" name="572" href="#572">572</a>   <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">void</strong> onControllerChange(<a href="../../../../../org/apache/helix/NotificationContext.html">NotificationContext</a>
changeContext)
+<a class="jxr_linenumber" name="573" href="#573">573</a>   {
+<a class="jxr_linenumber" name="574" href="#574">574</a>     LOG.info(<span
class="jxr_string">"Controller has changed"</span>);
+<a class="jxr_linenumber" name="575" href="#575">575</a>     refreshZkPropertyTransferUrl();
+<a class="jxr_linenumber" name="576" href="#576">576</a>     <strong class="jxr_keyword">if</strong>
(_zkPropertyTransferClient == <strong class="jxr_keyword">null</strong>)
+<a class="jxr_linenumber" name="577" href="#577">577</a>     {
+<a class="jxr_linenumber" name="578" href="#578">578</a>       <strong class="jxr_keyword">if</strong>
(_zkPropertyTransferSvcUrl != <strong class="jxr_keyword">null</strong> &amp;&amp;
_zkPropertyTransferSvcUrl.length() &gt; 0)
+<a class="jxr_linenumber" name="579" href="#579">579</a>       {
+<a class="jxr_linenumber" name="580" href="#580">580</a>         LOG.info(<span
class="jxr_string">"Creating ZkPropertyTransferClient as we get url "</span>
+<a class="jxr_linenumber" name="581" href="#581">581</a>             + _zkPropertyTransferSvcUrl);
+<a class="jxr_linenumber" name="582" href="#582">582</a>         _zkPropertyTransferClient
=
+<a class="jxr_linenumber" name="583" href="#583">583</a>             <strong
class="jxr_keyword">new</strong> <a href="../../../../../org/apache/helix/controller/restlet/ZkPropertyTransferClient.html">ZkPropertyTransferClient</a>(ZkPropertyTransferClient.DEFAULT_MAX_CONCURRENTTASKS);
+<a class="jxr_linenumber" name="584" href="#584">584</a>       }
+<a class="jxr_linenumber" name="585" href="#585">585</a>     }
+<a class="jxr_linenumber" name="586" href="#586">586</a>   }
+<a class="jxr_linenumber" name="587" href="#587">587</a> 
+<a class="jxr_linenumber" name="588" href="#588">588</a>   <strong class="jxr_keyword">void</strong>
refreshZkPropertyTransferUrl()
+<a class="jxr_linenumber" name="589" href="#589">589</a>   {
+<a class="jxr_linenumber" name="590" href="#590">590</a>     <strong class="jxr_keyword">try</strong>
+<a class="jxr_linenumber" name="591" href="#591">591</a>     {
+<a class="jxr_linenumber" name="592" href="#592">592</a>       <a href="../../../../../org/apache/helix/model/LiveInstance.html">LiveInstance</a>
leader = getProperty(keyBuilder().controllerLeader());
+<a class="jxr_linenumber" name="593" href="#593">593</a>       <strong class="jxr_keyword">if</strong>
(leader != <strong class="jxr_keyword">null</strong>)
+<a class="jxr_linenumber" name="594" href="#594">594</a>       {
+<a class="jxr_linenumber" name="595" href="#595">595</a>         _zkPropertyTransferSvcUrl
= leader.getWebserviceUrl();
+<a class="jxr_linenumber" name="596" href="#596">596</a>         LOG.info(<span
class="jxr_string">"_zkPropertyTransferSvcUrl : "</span> + _zkPropertyTransferSvcUrl
+<a class="jxr_linenumber" name="597" href="#597">597</a>             + <span
class="jxr_string">" Controller "</span> + leader.getInstanceName());
+<a class="jxr_linenumber" name="598" href="#598">598</a>       }
+<a class="jxr_linenumber" name="599" href="#599">599</a>       <strong class="jxr_keyword">else</strong>
+<a class="jxr_linenumber" name="600" href="#600">600</a>       {
+<a class="jxr_linenumber" name="601" href="#601">601</a>         _zkPropertyTransferSvcUrl
= <strong class="jxr_keyword">null</strong>;
+<a class="jxr_linenumber" name="602" href="#602">602</a>       }
+<a class="jxr_linenumber" name="603" href="#603">603</a>     }
+<a class="jxr_linenumber" name="604" href="#604">604</a>     <strong class="jxr_keyword">catch</strong>
(Exception e)
+<a class="jxr_linenumber" name="605" href="#605">605</a>     {
+<a class="jxr_linenumber" name="606" href="#606">606</a>       <em class="jxr_comment">//
LOG.error("", e);</em>
+<a class="jxr_linenumber" name="607" href="#607">607</a>       _zkPropertyTransferSvcUrl
= <strong class="jxr_keyword">null</strong>;
+<a class="jxr_linenumber" name="608" href="#608">608</a>     }
+<a class="jxr_linenumber" name="609" href="#609">609</a>   }
+<a class="jxr_linenumber" name="610" href="#610">610</a> }
 </pre>
 <hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
 </html>



Mime
View raw message