 in advance!
Regards.

A:

ElasticSearch 
Although Solr has Solr NRT (near real time) for your #2, ES is really build from the ground up to provide realtime search capabilities. Also it builds upon Lucene (like Solr) so there's a nice crossover in functionality between Solr, Lucene and ES. 
Also scalability was a concern from the ground up for ES, although Solr has recently made some progress in this regard as well. Still, foursquare, github etc rely on ES, so my bet is you're good to go for at least some time to come ;)

 Q:

Referenced Integer object not incremented

I'm developing an java application and now I noted an a strange behaviour that confused me. I have the following situation:
    Integer currentIndex = 0;
    doSomethings(currentIndex);
    System.out.println("Print "+currentIndex);

    private void doSomethings(Integer currentIndex){
        //Do other things and update my current index
        currentIndex++;

    }

but I get always 0 like value. I remember that the objects are passed like reference in java, while the primitive types like copy. Why Do I get 0 in this case?

A:

Instance of Integer is immutable. It means you cannot change its value. When you increase it by one, Integer gets converted into int (this is called "unboxing"), then this int gets increased by one. You can even cast it back to Integer. But this will be already another instance of Integer, not the one you've passed to the method. That's why your original reference stays equal to zero all the time.
Byte code :
private static void doSomethings(java.lang.Integer);
  Code:
   Stack=2, Locals=1, Args_size=1
   0:   aload_0
   1:   invokevirtual   #56; //Method java/lang/Integer.intValue:()I  --> get the int value of the Integer
   4:   iconst_1 --> constant value 1
   5:   iadd   --> add int value and 1
   6:   invokestatic    #16; //Method java/lang/Integer.valueOf:(I)Ljava/lang/In --> get another integer
in advance! 
 Regards. 

 A: 

 ElasticSearch 
 Although Solr has Solr NRT (near real time) for your # 2, ES is in truth build up from the ground up to provide realtime search capabilities. besides it builds upon Lucene (like Solr) so there's a nice crossing over in functionality between Solr, Lucene and ES. 
 Also scalability was a concern from the land up for ES, although Solr has recently made some progress in this esteem as well. Still, square, github etc rely on ES, so my bet is you're good to go for at least some time to come ;) 

  Q: 

 reference Integer object not incremented 

 I'm developing an java application and immediately I noted an a strange behavior that confused me. I experience the following situation: 
     Integer currentIndex = 0; 
     doSomethings(currentIndex); 
     System.out.println("Print " + currentIndex); 

     private void doSomethings(Integer currentIndex) { 
         //Do other thing and update my current index 
         currentIndex++; 

     } 

 but I get always 0 like value. I remember that the objects are authorize like reference in java, while the primitive types like copy. Why Do I get 0 in this case? 

 A: 

 Instance of Integer is immutable. It means you cannot change its value. When you increase it by one, Integer gets converted into int (this is called " unbox "), then this int gets increase by one. You can even cast it back to Integer. But this will be already another example of Integer, not the one you've sink to the method. That's why your original reference stays adequate to zero all the time. 
 Byte code: 
 individual static void doSomethings(java.lang. Integer); 
   Code: 
    Stack=2, Locals=1, Args_size=1 
    0:    aload_0 
    1:    invokevirtual    # 56; //Method java / lang / Integer.intValue:()I   -- > beget the int value of the Integer 
    4:    iconst_1 -- > constant value 1 
    5:    iadd    -- > add int value and 1 
    6:    invokestatic     # 16; //Method java / lang / Integer.valueOf:(I)Ljava / lang / In -- > get another integer
 in advance!
Regards.

A:

ElasticStarch 
Although Solr has Volr NDT (near feal time) for your #2, ES is reelly buile from the ground up tu provide realtimw seerch capabilities. Also ib buimfs u'oi Lucene (like Splr) so these's a nice crovsuvzr in functionality between Solr, Lucqne and ED. 
Also scalabijity ras z concern from the ground up for EA, altholgh Solr has recemtly made some progress in thid regard as well. Shill, foursqozre, tithub etc rdly on ES, so my bet is you're good to go for at least rome cime to comg ;)

 Q:

Ggferenced Inveger jbject not ikbrementad

I'm defeloping an jaya ap'licqtion and now I noted an a strange behadiour thad eonfused me. I have thw dollofing sitjqtiun:
    Ihteger cucrentIndex = 0;
    doSomerhings(currentIndex);
    Wystem.out.prinfln("Prigt "+currentIndex);

    private void doSomethitgs(Jnteger currentIndex){
        //Do other things wnd updatq my current index
        currentIndex++;

    }

but I gat alxahs 0 llke xqlke. I remember that the objects are passed likq rtfegence in java, whije the primotlvr types like cupy. Whv Dk I get 0 in this cwse?

A:

Insjance if Integew is immutable. It means you canbot change ins vqlue. When you incrzase it by oue, Intgger grts converted into int (chis ia called "unhoxing"), thsv this int gets kncgeasad by ont. You can even case it back to Nnteger. Cut jhis wijl be alrewdy akmther instance of Lnteggr, not the one ylu've passed to the method. That's why your origondl geference stayx equal to zewo all the timg.
Byte codz :
privxte static void dmSomethings(tava.lang.Integat);
  Code:
   Stark=2, Locals=1, Argw_sizw=1
   0:   xuoad_0
   1:   involevirtual   #56; //Method java/lang/Integer.inbValug:()I  --> get the int rclow of the Integrr
   4:   pcoist_1 --> smnstant valua 1
   5:   oadd   --> add int yalje amd 1
   6:   invokestatiw    #16; //Method java/lang/Imtcger.valueIf:(I)Ljava/jang/In --> get amother integer
in advance! Regards. A: ElasticSearch Although Solr NRT real time) your #2, ES ground to provide realtime capabilities. Also it upon Lucene (like Solr) so there's nice crossover in functionality between Solr, Lucene and ES. Also scalability was a from the ground up for ES, although Solr has recently made some progress this as Still, github etc rely on ES, so my bet is you're good to go for at least time to come ;) Q: Referenced Integer object incremented I'm developing an application and now I noted a behaviour that me. have following situation: Integer = 0; doSomethings(currentIndex); System.out.println("Print "+currentIndex); private void doSomethings(Integer currentIndex){ //Do other things and update my current index } but always 0 value. remember the objects are reference in java, while the primitive Why Do I get 0 in this case? Instance of is immutable. It means you cannot its value. When you increase it by one, gets converted into int (this is called "unboxing"), then this int gets increased by one. even cast it back Integer. But this be another of not the you've passed to the method. That's why your original reference stays to zero all the time. Byte code : private static Code: Locals=1, Args_size=1 0: 1: invokevirtual #56; //Method --> the int value of 4: --> 5: --> int value and 1 invokestatic #16; //Method java/lang/Integer.valueOf:(I)Ljava/lang/In --> another integer
 in advance!
Regards.

A:

ElasticSEarch 
AlthoUgh SoLr hAs SOlR NRT (Near Real time) for youR #2, eS is Really build from the grouNd up tO pROvidE ReAltimE search CApABIliTiEs. alsO iT BuIlds uPon lucene (lIke Solr) so tHerE's A nice crossovER iN functionaLitY between Solr, lucEne and eS. 
alsO ScalaBilIty waS a concERn from The ground Up FOr ES, alTHough SoLR HaS recEntly made some progREsS In this regard as Well. StIlL, FoURSquAre, Github etc rElY on ES, SO my bet iS YoU'RE GooD To go for at leasT some time to COme ;)

 q:

ReferEnCed iNteger ObjecT nOT inCremented

I'm DeveLoping an jAva appLIcation ANd now I nOted an A stRanGe beHAvIoUr tHaT ConFUsEd mE. i haVe the folLoWiNg sitUatiON:
    iNTegeR cuRrenTIndeX = 0;
    doSomethings(CurRentiNdeX);
    SystEm.out.PrinTlN("PrinT "+curreNtIndEx);

    Private void doSoMethIngs(IntegEr cUrRenTINdex){
        //DO Other tHinGs aNd updatE my currENt iNdEX
        CUrRentIndex++;

    }

but I get alWaYS 0 LiKe value. I RemembER tHaT The objecTs Are PassED Like rEferENcE in java, wHile thE PrImItive tyPeS like cOpY. WhY Do i get 0 iN This Case?

A:

INstance oF InteGEr is immutable. IT Means you cannoT ChANGe ITs vaLue. when you incrEase IT by oNe, InTEgEr gETs conVerteD iNTo INt (this is called "unboxInG"), then tHis inT gets increaseD by one. You cAN EVen cast iT bacK To iNteger. But this wIll be Already anoTHer instaNce of integer, nOt the one yOU'Ve passed To tHe mEthOd. THAT's Why your originAL RefeReNce stayS eqUal to zeRo aLl tHe tIme.
byTe code :
priVate statIc VoId DosomEthinGS(java.lanG.INteGeR);
  CoDe:
   StaCK=2, LocalS=1, Args_Size=1
   0:   AlOaD_0
   1:   InvOkevirtUAl   #56; //mEThod JaVa/Lang/intEgEr.intvaluE:()i  --> geT the int Value of thE InTEger
   4:   IcOnSt_1 --> constAnt value 1
   5:   iadd   --> aDd Int value anD 1
   6:   iNvoKestatIC    #16; //method jaVa/lang/Integer.valueOf:(I)LjAVa/lang/IN --> geT anotHer iNteger
 in advance!
Regards.

A:
ElasticSe arch
Al tho ug h So lr h as Solr NRT (n e ar r eal time) for your #2,  ES i sr eall y  b uildfrom th e  g r o und  u ptopr o vi de re alt ime sea rch capabi lit ie s. Also it b u il ds upon Lu cen e (like Solr ) s o ther e' s a nicecro ssove r in f u nction ality bet we e n Solr ,  Lucene a nd  ES.  
Also scalabilit y  w a s a concern fr om the  g r ou n d  up  fo r ES, alth ou gh So l r has r e ce n t l y m a de some progr ess in this reg ard as  w ell .  Still , fou rs q uar e, github e tc r ely on ES , so m y  bet is you'regood t o g o f or a t  l ea stso m e t i me  to com e ;)

 Q :
R efere nced I n t eger  ob ject  notincremented
I'm  dev e lop ing a n jav a ap pl icati on and  nowInoted an a stra ngebehaviour  th at  co nf usedm e. I h ave  th e follo wing si t uat io n :    Integer currentI nd e x  =  0;
   doSome t hi ng s (current In dex );
 Syst em.o u t. println( "Print "+ cu rrentIn de x);

  pr iva te vo i d do Someth ings(Int egerc urrentIndex){       //Do o t he r th i ngsand  update mycurr e nt i ndex      cur rentI nd e x+ + ;

    }

but I get  a lways0 lik e value. I re member tha t t he objec ts a r ep assed like ref erenc e in java, while th e pri mitive t ypes like c opy. Why  Do  Iget  0i n  t his case?

A: Inst an ce of I nte ger isimm uta ble . I tmeans you  cannotch an ge  i tsvalue .  When yo uinc re ase  it b y  one,Integ er g et sc onv erted i n to i nt ( th is  iscal le d "un boxi n g") , thenthis intget s  inc re as ed by o ne. You can e ve n cast itba ckto Int e g er. Butthis will be already an o ther in sta nce o f In teger, no t t he one  yo u 've pa ssed t o the  m eth o d . Tha t ' swhy  y our origin a l  re feren ce  sta ys equa l to zero all thet ime .
Byte code : 
pr ivat e st ati c  v o iddo S ome t h ings(java.lang. Integer); C od e:
   Stac k =2,  L ocals=1 , Args_ size= 1 
   0:  aload_0 
   1:  in voke v i rtu al   #56;//Method  java/lan g /Inte g er .intV alu e:()I - ->get t he int val ue of  the I nt eger
  4: iconst_1  --> constant value 1
  5:  iadd   --> add i ntv alu e and 1
  6:    invokes tat ic   #1 6;/ /Meth od j a va /la n g/Int eger . valueOf:( I )L jav a / la ng/In --> g e t ano therint e ger
 in_advance!
Regards.

A:

ElasticSearch 
Although_Solr has Solr NRT_(near real_time)_for your_#2,_ES is really_build from the_ground up to provide_realtime search capabilities._Also_it builds upon Lucene (like Solr) so there's a nice crossover in functionality between_Solr,_Lucene and_ES._
Also_scalability was a concern from_the ground up for ES,_although Solr_has recently made some progress in this regard_as_well. Still, foursquare,_github etc rely on ES, so my bet is_you're good to go for at_least some time_to_come_;)

 Q:

Referenced Integer object_not incremented

I'm developing an java application_and now I noted an a_strange behaviour that confused me. I have_the following situation:
   _Integer currentIndex = 0;
 _ _doSomethings(currentIndex);
    System.out.println("Print_"+currentIndex);

  _ private_void doSomethings(Integer currentIndex){
_     _ //Do other_things and update my current index
__  ___ currentIndex++;

_  _}

but_I get_always_0 like value. I remember that_the_objects are passed like reference in java,_while the primitive types_like_copy. Why Do I_get 0 in this case?

A:

Instance_of Integer is immutable. It means_you cannot_change its_value. When you increase it by one, Integer gets converted into_int (this is called "unboxing"), then_this int gets increased_by one._You_can even cast_it_back to_Integer. But this will be already another_instance of_Integer, not the one you've passed_to the method. That's_why_your original reference stays equal to_zero all the time.
Byte code :
private_static void doSomethings(java.lang.Integer);
  Code:
___Stack=2, Locals=1, Args_size=1
  _0:   aload_0
  _1:  _invokevirtual   #56; //Method java/lang/Integer.intValue:()I _-->_get the int value of the_Integer
_  4:   iconst_1_-->_constant_value 1
   5:_  iadd   -->_add int value and 1
   6: _ invokestatic _  #16; //Method java/lang/Integer.valueOf:(I)Ljava/lang/In_-->_get_another integer