Showing posts from October, 2015

Collection holds value as a refernce in java

Value as a Reference example : Here we are fecthing a list from a collection and updating this which leads to automatic update of Map because numList is directly referring to  testmap.

public class ValueAsReference{

enum EvenOdd{
public static void main(String ... arg){

Map<String,List<String>> testmap=new HashMap<String, List<String>>();
for(int i=0;i<20;i++){
String key="";
if(i%2 ==0){

List<String> numList=testmap.get(key);

numList=new ArrayList<String>();
testmap.put(key, numList);
for(String key : testmap.keySet()){
System.out.println("key : "+key);

Output :
key : EVEN
[i=0, i=2, i=4, i=6, i=8, i=10, i=12, i=14, i=16, i=18]
key : ODD
[i=1, i=3, i=5, i=7, i=9, i…

Google App Engine deleted default GCS bucket. Is there a way to restore it?

No, there is no way to restore a deleted bucket or object inside a bucket. DELETE operation comes under strong global consistency. Keep in mind that you can use Google Cloud Storage only after enabling billing for your project. It's not free.

You can go through Cloud storage documentation

Bucket will be deleted permanently. You can see google documentation. Although a bucket will be deleted only if it is empty, means you have to delete all objects first and then you can delete an empty bucket. Choose bucket carefully as these are unique globally and can not be nested like folders or directories.