Posts

Micro Service

Image
Amazon  C ircuit Breaker :  When the number of consecutive failures crosses a threshold, the circuit breaker trips, and for the duration of a timeout period all attempts to invoke the remote service will fail immediately. After the timeout expires the circuit breaker allows a limited number of test requests to pass through. If those requests succeed the circuit breaker resumes normal operation. Otherwise, if there is a failure the timeout period begins again. @EnableCircuitBreaker class UserRegistrationConfiguration { Amazon <a target="_blank" href="https://www.amazon.in/b?_encoding=UTF8&tag=bayareddy-21&linkCode=ur2&linkId=15ff6c4a39b041249058632ec17c92c8&camp=3638&creative=24630&node=1389375031">TV</a>

Java 8

 package com.java8.functional; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; public class Test { // Functional interfaces // -Predicate // -BinaryOpeator // -Function public static void main(String[] args) { // -Predicate Predicate<String> strPrd=(s)->s.equals("baya"); Predicate<String> strPrd1=(s)->s.equals("baya1"); System.out.println(strPrd.or(strPrd1).test("baya1")); List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);   Predicate<Integer> even=(i)->i%2==0;    System.out.println(list.stream().filter(even).collect(Collectors.toList())); System.out.println(list.stream().filter(even.negate()).collect(Collectors.toList()));   // -BinaryOpeator B

temp

Image

SqLite Setup

  Step1 : Download SQLite SW with bellow URL. SQLITE Step2 

View & Materialized View

Comparison Chart BASIS FOR COMPARISON VIEW MATERIALIZED VIEW Basic A View is never stored it is only displayed. A Materialized View is stored on the disk. Define View is the virtual table formed from one or more base tables or views. Materialized view is a physical copy of the base table. Update View is updated each time the virtual table (View) is used. Materialized View has to be updated manually or using triggers. Speed Slow processing. Fast processing. Memory usage View do not require memory space. Materialized View utilizes memory space. Syntax Create View V As Create Materialized View V Build [clause] Refresh [clause] On [Trigger] As

Control statements

Image
                                      Control statements Control statements :- A control statement works as a determiner for deciding the next task of the other statements whether to execute or not. if Statement : Simple if statement is the basic of decision-making statements in Java. It decides if certain amount of code should be executed based on the condition. Syntax: if (condition) {          Statemen 1; //if condition becomes true then this will be executed } Statement 2; //this will be executed irrespective of condition becomes true or false example : class IfStatement {     public static void main(String[] args) {     int number = 10;     if (number > 0) {     System.out.println("Number is positive.");     }     System.out.println("This statement is always executed.");     } } if…else Statement : In if…else statement, if condition is true then statements in if block will be executed but if it comes out as false then