Question
USE JAVA CODE FOR SOLUTION PLEASE write a program that is able to find the optimal allocation of fragment replicas to sites in a distributed
USE JAVA CODE FOR SOLUTION PLEASE
write a program that is able to find the optimal allocation of fragment replicas to sites in a distributed database.
The program will read and parameter file which defines necessary parameter to decide how each fragment will be access in term of the expected cost of query and update, expected probability of query and update to each fragment.
the # indicates the comments of each parameter.
Your program should be able to find and print optimal allocation for each fragment and display the overall cost of all possible replication as well. The optimal replication which is the lowest cost among all should be also printed. The sample input file looks like below:
#Total number of fragment 3
#Expected cost of a remote query to fragment i. 1.0, 1.0, 1.3
#Expected cost of a remote update to fragment i. 1.2, 1.5, 2.0 #Number of sites 4
#Expected probability that fragment i is queried by site j.
1.0, 1.0, 0.4, 0.0
0.0, 0.4, 0.7, 1.0
0.0, 1.0, 1.0, 0.0
#Expected probability that fragment i is updated by site j.
0.6, 0.4, 0.0, 0.0
0.0, 0.0, 0.4, 0.6
0.0, 0.5, 0.5, 0.0
The sample partial output of the program Number of sites: 4 Computing optimal allocation for fragment 0 x=[0,0,0,0], exptected cost =2.4 x=[1,0,0,0], exptected cost =1.88 x=[0,1,0,0], exptected cost =2.12 Fragment 0: Optimal Replication =[1,1,0,0], min Cost =1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started