Big Data大数据,谈的不仅仅是数据量,其实包含了数据量(Volume)、时效性(Velocity)、多样性(Variety)、可疑性(Veracity): Volume:数据量大量数据的产生、处理、保存,谈的就是Big Data就字面上的意思,就是谈海量数据 Velocity:时效性这个词我有看到几个解释,但我认为用IBM的解释来说是比较恰当的,就是处理的时效,既然前头提到Big Data其中一个用途是做市场预测,那处理的时效如果太长就失去了预测的意义了,所以处理的时效对Big Data来说也是非常关键的,500万笔数据的深入分析,可能只能花5分钟的时间 Variety:多变性指的是数据的形态,包含文字、影音、网页、串流等等结构性、非结构性的数据 Veracity:可疑性指的是当数据的来源变得更多元时,这些数据本身的可靠度、质量是否足够,若数据本身就是有问题的,那分析后的结果也不会是正确的。
package com.example.smartgrid; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import org.apache.http.util.EntityUtils; import android.app.Activity; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; public class EditActivity extends Activity { EditText AppName = null; EditText wattage = null; EditText startTime = null; EditText endTime = null; EditText runTime = null; EditText constraint = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edit); AppName = (EditText)findViewById(R.id.editText2); wattage = (EditText)findViewById(R.id.editText3); startTime = (EditText)findViewById(R.id.editText4); endTime = (EditText)findViewById(R.id.editText5); runTime = (EditText)findViewById(R.id.editText6); constraint = (EditText)findViewById(R.id.editText7); Button edit = (Button)findViewById(R.id.button1); edit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { new EditTask().execute(); } }); } private class EditTask extends AsyncTask项目下载: BigData-master 地址:https://github.com/azeemshaikh38/BigData{ String HadoopoutEdit; protected Double doInBackground(Void... voids) { postData(); return null; } public void postData() { EditText ipAddress = (EditText) findViewById(R.id.editText1); HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://" + ipAddress.getText() + "/editAppliance.php"); try { List nameValuePairs = new ArrayList ( 1); nameValuePairs.add(new BasicNameValuePair("Name", AppName .getText().toString())); nameValuePairs.add(new BasicNameValuePair("StartTime", startTime.getText().toString())); nameValuePairs.add(new BasicNameValuePair("EndTime", endTime .getText().toString())); nameValuePairs.add(new BasicNameValuePair("Wattage", wattage .getText().toString())); nameValuePairs.add(new BasicNameValuePair("RunTime", runTime .getText().toString())); nameValuePairs.add(new BasicNameValuePair("Constraint", constraint.getText().toString())); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); HadoopoutEdit = EntityUtils.toString(entity); } catch (Exception e) { Log.e("log_tag", "Error in http connection " + e.toString()); return; } } protected void onPostExecute(Double result) { AppName.setText(""); wattage.setText(""); startTime.setText(""); endTime.setText(""); runTime.setText(""); constraint.setText(""); } } }
收藏的用户(0) X
正在加载信息~
推荐阅读
两张图看透Android Handler使用与机制
最新回复 (0)
站点信息
- 文章2302
- 用户1336
- 访客10962994
每日一句
Progress starts with one brave step forward.
进步始于一次勇敢的迈步。
进步始于一次勇敢的迈步。
新会员