• No results found

Improving Mapreduce for Incremental Processing Using Map Data Storage

N/A
N/A
Protected

Academic year: 2021

Share "Improving Mapreduce for Incremental Processing Using Map Data Storage"

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

Procedia Computer Science 87 ( 2016 ) 288 – 293

1877-0509 © 2016 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).

Peer-review under responsibility of the Organizing Committee of ICRTCSE 2016 doi: 10.1016/j.procs.2016.05.163

ScienceDirect

Corresponding author. Tel.: +91-9400532954; E-mail address: akr808@gmail.com

4th International Conference on Recent Trends in Computer Science & Engineering

Improving Mapreduce for Incremental Processing Using Map

Data Storage

Anandkrishna R

a

,Dhananjay Kumar

b

aDepartment of Information Technology,Anna University MIT Campus,Chennai,India. bDepartment of Information Technology,Anna University MIT Campus,Chennai,India.

Abstract

In this paper, we propose methods for the improvement of performance of a MapReduce program when it is used for incremental processing. Incremental processing is generally used where data is refreshed periodically to reflect small changes to the input dataset. To reduce the delay in re-computing unchanged data, we introduce methods that selectively compute only data that has been altered. It incorporates the concept of Bloom Filter. Bloom filter is a space-efficient data structure, that can with a certain probability check if the data is modified or not. Traditional systems process the entire data when even a small percentage or none of data is changed. This is time-consuming as well as consumes a huge number of CPU clock cycles additionally to process data that has not been changed. In order to reduce the wastage of CPU clock cycles, a system is proposed wherein a method of execution using Bloom Filter helps improve the performance of the system up to 17 % when compared to existing system.

© 2016 The Authors. Published by Elsevier B.V.

Peer-review under responsibility of the Organizing Committee of ICRTCSE 2016.

Keywords:MapReduce; Incremental Processing; Hadoop; Distributed computing; Bloom Filter.

1.

Introduction

With the evolution of technology, the cost per bit of data has gone down drastically. This has led to the introduction of the concept of Big data. The emergence of tremendous data from various sources overwhelmed the traditional computing techniques which soon became incapable of handling such data. The sources of data increased that its volume, variety, veracity, velocity became the key V’s of consideration although other

parameters like complexity, variability, visualisation etc. were suggested.

1.1.MapReduce

The MapReduce framework helps easily write applications which process large amounts of data, up to several Terabytes, in parallel on large clusters, consisting of hundreds of nodes made using commodity hardware, with highly reliable and fault-tolerant manner. The key idea behind MapReduce is mapping the data set into a collection of <key, value> pairs, and then reducing all the pairs with the same key.

A MapReduce task segregates the input data into several independent blocks each of which are then processed by the map process in parallel as shown in Fig 1(a). The output of the Map task is then passed to the shuffle task. There is TaskTracker that keeps the status of the tasks running and is responsible for the completion of the task. The TaskTracker respawns failed tasks to ensure completion. The Reducer stage has three stages

– shuffle phase, sort phase and the reduce phase. In the Shuffle phase, the output from the Mappers is given to the Reducer after sorting it. The © 2016 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license

(http://creativecommons.org/licenses/by-nc-nd/4.0/).

(2)

MapReduce framework then gathers the portion of the output from all the mappers using HTTP protocol. During the Sort phase, the MapReduce programming framework then groups the outputs that have the same inputs by the assigned keys value.

Both the shuffle phase and sort phase occur parallelly. The mapper program output pieces are fetched simultaneously as they get merged. A secondary sort is used when equivalence rules that are used for the grouping of intermediate keys are different from those for grouping keys that are used before reduction. It is often used to track how intermediate keys are grouped together, and be used in additionally to simulate secondary sort on values. The final phase of the MapReduce program is the reduce phase. The reduce phase uses results from shuffler as input and parallelly run them across several reducers. The reduce tasks are then consolidated into the final result.

1.2.Advantages of MapReduce programming

The advantages of MapReduce programming are Scalability, Cost-effective solution, Flexibility in environment, Fast Execution, Security and Authentication, Parallel processing, Availability and resilient nature. These advantages of MapReduce approach are often taken advantage to implement various algorithms.

2.

HDFS Architecture

Hadoop is a distributed processing system developed by Apache. The performance of Hadoop is maximum when the tasks are independent of each other. Hadoop comprises of a storage component HDFS (Hadoop Distributed File System) and a processing component (MapReduce). The general structure of HDFS is shown in Fig 2. Hadoop splits files into large chunks and distributes them to the processing elements of the distributed system. The system moves the code closer to data rather than moving the data to the code. The latter is costlier (time consuming) when compared to the former. This approach is known of principle of data locality. In this method, the nodes process the data that they have on site rather than importing the data off-site. HDFS comprises of the following components:

2.1.NameNode

It is the master of the system. It contains meta data. The metadata stores the information regarding the file fragments and the replicas stored across the DataNodes. The NameNode performs the task managing functions by assigning the execution to the slave nodes or data nodes. The NameNode ensures that a task completes successfully and handles the failure of the slave nodes (data nodes) by using the replicas of the fragments.

2.2.DataNodes

They are the also called slaves. They are deployed on each distributed machine and provide storage as well as processing power to the system. They fulfil the read and write requests for the clients.

2.3.Secondary NameNode

Their primarily responsibility is creating periodic checkpoints during the system functioning to facilitate rollback when any failure occurs. When a NameNode fails, it can be restarted using the checkpoint.

A failure of any DataNode is detected using the heartbeat signal. The NameNode periodically checks the liveness of each of the slaves in the system. When a DataNode does not respond at the expiry of a timer, it is assumed to be dead. The failure of NameNode was a Single Point of Failure(SPOF) until Hadoop v2.0. Thereafter the distributed system can have multiple NameNode running. When a NameNode fails any other NameNode can take over. This provides high resilience to failures

3.

Incremental processing

In incremental processing, the system has a huge repository of data that is updated as the incoming data is processed. The size of the incoming data is very small when compared to the size of the existing data. Incremental processing is widespread used in areas such as searching, indexing. When a new content is added instead of computing the whole data again, the system propagates the changes saving the execution time. Incremental processing of data is done in chunks so that the data modification is done only for the necessary areas.

4.Bloom Filter

4.1.Principle of Operation

The Bloom filter is a (probabilistic) data structure for performing approximate membership queries. The use of a Bloom filter uses a constant memory. If a Bloom filter gives a false, it means that the data has not occurred. When it gives a true, it means that the value may have occurred (with a certain level of certainty). This is because of the occurrence of false positives. By using several Bloom filters, the probability of a false positive can be minimised. Bloom filters have many network applications that support quick matching of membership query because of their randomized, space-efficient data structure with a reasonable or limited probability of occurrence of false answers. A Bloom filter has constant time complexity in both adding items as well as for checking the membership of a data value. This is because the data presence is detected using hash functions and a message bit set. The size of the bet set is much smaller when compared to the whole data. The hash functions that are used in

(3)

Bloom filters, collisions in the hash values does not have a significant effect on its performance, as they are rare. It is important that the outputs be evenly and randomly distributed throughout the bit set. Hence, the performance of the system is dependent mainly on the performance of the hash function. The probability of a Bloom filter to generate an answer true when the data has not been present is call a false positive. A false probability in a Bloom filter is proportional to the ratio of bits that are set to the number of bits not set raised to the power of the number of hash functions. The probability of false positive can be reduced in two ways−increasing the size of the bitset or by increasing the number of hash functions. 5. System Architecture

The architecture of the data store implemented is shown in Fig 3. It represents how the data elements are stored and represented when an increment is added.

Fig. 1. (a) MapReduce normal flow (b) Mapreduce flow using Bloom Filter.

The algorithm in its initial run performs similarly to the plain MapReduce program. It takes the input and splits them into data blocks and then reduce them separately and then run the reducer task on them. The result is combined to get the final result.During the successive run of the program, the data that is modified is detected using the Bloom filter as shown in Fig.1(b). The data that the Bloom filter finds to be changed is executed and the final result is recomputed using the results of the previous iteration.

During the incremental run as shown in Fig 5, only the data that is modified is compiled again and not the complete input set. The newly inserted data is passed to a reducer and the reducer is run again. If the data is not modified, then the reducer just passes the previous result. A bit set used in the Bloom Filter is used to identify if the data is changed or not.

(4)

Fig. 2. Iterative MapReduce during successive iterations.

6.Mathematical Modelling of Bloom Filter.

The efficiency of a Bloom filter is measured as the probability of occurrence of false positives.

Let ‘b’ denote the number of bits present in the bit set of the Bloom filter. The probability that the bit is not set is

ቀͳെͳ

ܾቁ (1)

Let there be k hash function, the probability of any of those bits set is ቀͳെͳ

ܾቁ ݇

ሺʹሻ

After inserting n elements, the probability that the bit is still zero is ቀͳെͳ

ܾቁ ݇݊

ሺ͵ሻ

So, the probability of a bit not set is

ͳെ ቀͳെͳ

ܾቁ ݇݊

(4) Probability of false positives is

൬ͳെ ቀͳെͳ ܾቁ ݇݊ ൰ ݇ ൎቀͳെ ݁െܾ݇݊݇ (5)

Optimising the Bloom filter performance, we take the derivative and equate to 0. kopt =

ܾ

݊ ln 2 (6)

The probability of false positives increases with the number inputs and decreases with the increase in the size of the Bloom Filter.

7.

Algorithms

Algorithm 1: MapReduce Initial run

Data: Input data set for the MapReduce during the initial run.

Function: MapReduce(Data Set)

for every data element in datasetdo

/* Generate Key, Value pair for every element */

(K,V) ← Mapper(Data)

/* Insert data into the Bloom filter for the corresponding reducer */ Insert(value)

Reduce()

end end

The first time the algorithm is run, it is similar to the plain MapReduce program. This is because there is no previous bit set that can be used to compare the inputs. Hence all the input is mapped and reduced while the Bloom Filter algorithm is run.

Algorithm 2: Bloom filter insertion

Data: Let x the object that is to be inserted into the Bloom filter.

Function: Insert(x)

begin

for i in 1…. k do

/* Apply all the hash functions to input x*/ j ← hi(x);

if Bj= 0 then

/* Bloom filter’s bit unset atposition j, so set it*/ Bj←1;

end end

The bloom filter algorithm insertion computes the hash function values for every input it receives. These values are used to set the locations correspondingly to 1 in the bit set.

Algorithm 3: MapReduce in iterative run.

Input Data: Input data set for the MapReduce during the iterative run.

Function MapReduce(Data Set)

begin

for every data element in data set do

/* Generate Key,Value pair for every element */

(K,V) ← Mapper(Data with)

/* Insert data into the Bloom filter for the corresponding reducer */ Insert(value)

/* For every modified element */

(5)

if ismember(x) for reducer r = True then

invoke Reduce() for r

end end end

The iterative run of the MapReduce program uses the bloom filter that has been set on the previous iteration to compute thevalues that have been altered and then runs the Map and Reduce tasks only for those values that have been altered.

Algorithm 4: Bloom Filter membership test

Input Data: Let x be the object key for which membership is tested.

Function: ismember(x) returns value true or false according to its membership test

begin m ← True; i ← 1; whilem == 1 and i ≤ k do j ← hi(x); if Bj == 0 then m ← False; end i ← i + 1; end return m; end

The Membership checking function takes an input and computes the hash functions and generates the list of all the bits to be set for the corresponding data. Once the list is generated, the list is used to check if the bits at the locations are set or not. If all the bits at the locations are set,

then the method returns a ‘true’. If at least one of the bit is not set, then the method returns a ‘false’.

8.Implementation and Results

The performance of the system was compared with each phase of the existing system and the systems proposed by others. The time for execution at each phase is measured and plotted. The system was implemented using Hadoop 2.5 cluster with each node of Intel core i5 and 4GB RAM. The implementation was clocked at various stages as well as compared with various algorithms.

The proposed system was compared to each stages of its MapReduce execution-Map, Shuffle, Sort and Reduce and the execution time is plotted in Fig 3(a).It was observed that the performance of the system that incorporated Bloom filter was outperformed the system that did not use iterative computing. As shown in Fig 3(a), the plain MapReduce program did not perform well as it repeated every step of the MapReduce program. The iterative MapReduce concept achieved a greater performance than the traditional MapReduce program.

The plain MapReduce program executes the completely executes all the inputs irrespective of whether they have been processed earlier or not. The IterMR computes the data much more efficiently than the plain MR, but still suffers from several fallouts as it is designed for iterative

processes.

Fig. 3. (a) Performance analysis with various algorithms using normalised execution time.

(b) Run time of various stages in Word Count Program

0

200

400

600

800

1000

1200

1400

Map

Shuffle

Sort

Reduce

Exe

cution T

im

e(s

)

Plain MR

IterMR

Inc MR Optimised

0

0.2

0.4

0.6

0.8

1

1.2

PageRank

K-means

Exe

cution time

(6)

Corresponding author. Tel.: +91-9400532954; E-mail address: akr808@gmail.com

The IncMR designed for incremental processing gives a great performance improvement over several rounds of execution. The first iteration is same as the plain MapReduce program. The first phase generates the bit map of the Bloom filter. Once this is finished, the iterations that succeeds uses the Bloom filter bitmap of the previous iteration to selectively compute the data that has been modified since the previous iteration.

9.Conclusion and future work

In this work we proposed the incorporation of Bloom Filter to improve the performance of MapReduce programs. The primary advantage of using a Bloom filter is to efficiently compute the presence or absence of data with very high spatial efficiency. We observed that the program execution time was reduced when compared to plain MapReduce program and also improved significantly when compared with existing system.

This method can be incorporated into the MapReduce framework so that the MapReduce program need not be modified. The programmer programs the system without any modifications. The internal functioning takes care of the increments.

Further enhancements in the use of Bloom Filter such as multilevel Bloom Filters or Bloom Filters that support deletions can be also incorporated to give added performance improvements.

Improvements in the fault tolerance by the distribution of the Bloom filter data is an area of development. Also, this would increase the performance parametric by avoiding bottlenecks and also removing Single Point of Failure.

References

1. Dean, J. & S. Ghemawat, 2008. MapReduce: simplified data processing on large clusters. Commun. ACM, 51(1), 107-13.

2. Ene, S., B. Nicolae, A. Costan & G. Antoniu, 2014. To Overlap or Not to Overlap: Optimizing Incremental MapReduce Computations for On-Demand Data Upload, in Data-Intensive Computing in the Clouds (DataCloud), 2014 5th International Workshop on, 9-16.

3. Deke, G., L. Yunhao, L. XiangYang & Y. Panlong, 2010. False Negative Problem of Counting Bloom Filter. Knowledge and Data Engineering, IEEE Transactions on, 22(5), 651-64.

4. Yanfeng, Z., C. Shimin, W. Qiang & Y. Ge, 2015. MapReduce: Incremental MapReduce for Mining Evolving Big Data. Knowledge and Data Engineering, IEEE Transactions on, 27(7), 1906-19.

5. Agarwal, P., G. Shroff & P. Malhotra, 2013. Approximate Incremental Big-Data Harmonization, in Big Data (BigData Congress), 2013 IEEE International Congress on, 118-25.

6. Bhatotia, P., A. Wieder, R. Rodrigues, U.A. Acar & R. Pasquin, 2011. Incoop: MapReduce for incremental computations, in Proceedings of the 2nd ACM Symposium on Cloud ComputingCascais, Portugal: ACM, 1-14.

7. Bhushan, M., M. Singh & S.K. Yadav, 2015. Big data query optimization by using Locality Sensitive Bloom Filter, in Computing for Sustainable Global Development (INDIACom), 2015 2nd International Conference on, 1424-8.

8. Cairong, Y., Y. Xin, Y. Ze, L. Min & L. Xiaolin, 2012. IncMR: Incremental Data Processing Based on MapReduce, in Cloud Computing (CLOUD), 2012 IEEE 5th International Conference on, 534-41.

9. Fang, H., M. Kodialam & T.V. Lakshman, 2008. Incremental Bloom Filters, in INFOCOM 2008. The 27th Conference on Computer Communications. IEEE, 1.

10. Jun, Z., L. Zhu & Y. Yong, 2012. Parallelized incremental support vector machines based on MapReduce and Bagging technique, in Information Science and Technology (ICIST), 2012 International Conference on, 297-301.

11. Khopkar, S.S., R. Nagi & A.G. Nikolaev, 2012. An Efficient Map-Reduce Algorithm for the Incremental Computation of All-Pairs Shortest Paths in Social Networks, in Advances in Social Networks Analysis and Mining (ASONAM), 2012 IEEE/ACM International Conference on, 1144-8.

Figure

Fig. 1.  (a) MapReduce normal flow   (b) Mapreduce flow using Bloom Filter.
Fig. 3.  (a)     Performance analysis with various algorithms using  normalised execution time

References

Related documents

As these metabolic hormones also play integral roles in the development of major hypothalamic pathways required for maintaining energy homeostasis [127] and in responses to

Each condition is applied to a speech sample from all four speakers, meaning that if a test has 10 conditions, it has 40 degraded speech samples, one from each speaker for

Moreover, the current study aims to investigate the relationship between five dimensions of community capacity in conserving natural environment namely;

The parameters o f the m odel consist o f the size o f the data sent to and received from the secondary processors, the com putation cost function,

Having reaped low hanging fruits in 2015, FinTech Group was able to significantly turn around its business (both B2B and B2C) and to streamline its operations boosting

To that end, the Open Travel Alliance (OTA) was formed in 1998 and now has a global membership of over 150 travel companies from suppliers, such as airlines, hotels, car rental, rail,

Saturated hydraulic conductivity was also evaluated us- ing a constant head system, with the values at the lowest tar- get dry matter density (150 kg m -3 ) representing only 16.7%