Friday, September 15, 2017

Missing Artifact JDK Tools Jar

While building hadoop application, you may get below error

 

Missing Artifact JDK Tools Jar


Problem is, hadoop system couldn't find the java tools. to resolve this issue, you have need to add java path in the pom file



    <dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.7.0_05</version>
<scope>system</scope>
<systemPath>C:\ProgramFiles\Java\jdk1.8.0_121\lib\tools.jar</systemPath>
 </dependency>

Friday, September 1, 2017

Get started with HDP 2.6

Follow the below points to get started with hortonworks data platform 2.6

1.download HDP 2.6
2.add it to Vmware
3.play the virtual machine
4.By default, you can use root/hadoop credential in order to connect
5.at this point, you want to connect to ambari, it will fail to connect.saying username/pwd wrong.
6. to resolve above point, go to virtual machine , run below command
      $ssh root@127.0.0.1 -p 2222
   
      above cmd will ask you to change pwd . do so.

      once this is done , run below cmd as well
      $ ambari-admin-password-reset

      this will also ask to enter new password

      once you entered password , then ambari server will restart.

      now you can connect from web url.

Saturday, January 7, 2017

Connecting your android phone on your localhost


I have followed below steps to get it done


  1. Disconnect network cables on laptop or  turn off wifi.
  2. Turn off wifi on android device
  3. Connect android phone to laptop via USB cable 
  4. Turn on "USB Tethering" in the android settings menu -> Tethering and portable hotspot
  5. Get the IP of your computer. (open command prompt and type "ipconfig" then look for the IP )
  6. Open a browser on the laptop using the IP address found instead of localhost to test. i.e.                     http://192.168.x.x/abc/services/v1/
  7. Now, type the same URL in android browser 


It might be very helpful when you wants to test some webservice on phone. 

Sunday, January 1, 2017

TortoiseGit-git did not exit cleanly (exit code 1)


Solution to the error :   TortoiseGit-git did not exit cleanly (exit code 1)


Right click -> TortoiseGit -> Settings -> Network
SSH client was pointing to C:\Program Files(x86)\TortoiseGit\bin\TortoisePlink.exe
Changed path to C:\Program Files (x86)\Git\bin\ssh.exe

Saturday, December 17, 2016

Admob is not displaying testAds

I have encountered sample problem , test ad is not displaying it 

There was a problem getting an ad response. ErrorCode: 1

If you look at the logcat logs, it will be very clear that, there is an issue with unit_id

in my case , i got the unit id like below

ca-app-pub-***74739*******~334934****


the issue here is, ca-app-pub-***74739*******~334934****
it should be  ca-app-pub-***74739*******/334934****


and ofcourse , need to provide the sufficient space for the add in the layout.
try removing layout_margin and padding which is applied in root element in the layout. 

Monday, November 28, 2016

Spark deployment error and solution

error : Application application_1 failed 2 times due to AM Container for appattempt_2 exited with exitCode: 15

Spark submit command I used :
./bin/spark-submit  --class com.saitech.stockmain --master yarn --deploy-mode cluster \
     --driver-memory 1g \
    --executor-memory 1g \
    --executor-cores 2 \
/home/gobisubramani/jar/StockApp-0.0.1-SNAPSHOT.jar

in the main method
  val sparkConf = new SparkConf()
   .setMaster("yarn")
        .setAppName("my stock app")
       

In the main method also I have mentioned my Master, I just removed it . Now I am not getting that error.

  val sparkConf = new SparkConf().setAppName("my stock app")

    However I would recommand to take logs to analyse the issue


Note: I'll update this blog as soon as I come across any deployment issue 

Saturday, October 8, 2016

Get Top N Records per Group

One of the most asked query in the interview,
      how to get top N record in hte each group
      get 15th largest records from DB with out using limit

you can solve above problem statement using rank concept

create a new column in table it will rank your records , by using this rank you can resolve above problem






query and sample dataset  you can get it from the aboe screenshot . and of course result set as well.

basic idea is , creare a session varibale which will increment the rank.
at the end get the result set based on the rank.