原创

Error in deleting blocks.

版权声明:本文为博主原创文章,遵循 CC 4.0 BY 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://lidong.blog.csdn.net/article/details/46433323
2014-08-24 22:15:21,714 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Error processing datanode Command
java.io.IOException: Error in deleting blocks.
        at org.apache.hadoop.hdfs.server.datanode.FSDataset.invalidate(FSDataset.java:1967)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.processCommand(DataNode.java:1181)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.processCommand(DataNode.java:1143)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.offerService(DataNode.java:980)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.run(DataNode.java:1527)
        at java.lang.Thread.run(Thread.java:724)



展开阅读全文

gridview控件的deleting事件怎么写

04-21

protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)rn rn rn string sqlstr = "delete from student where ID='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";rn strconn = ConfigurationSettings.AppSettings["dsn"];rn con = new SqlConnection(strconn);rn con.Open();rn cmd = new SqlCommand(sqlstr , con);rn rn cmd.ExecuteNonQuery();rn con.Close();rn bind();rn rnrn public void bind()rn rn string sqlstr = "select ID,name,sfz,sex,class,grade,department from student";rn strconn = ConfigurationSettings.AppSettings["dsn"];rn con = new SqlConnection(strconn);rn SqlDataAdapter myda = new SqlDataAdapter(sqlstr, con);rn DataSet myds = new DataSet();rn con.Open();rn myda.Fill(myds, "student");rn GridView1.DataSource = myds;rn GridView1.DataKeyNames = new string[] "ID" ;//主键rn GridView1.DataBind();rn con.Close();rn rn索引超出范围。必须为非负值并小于集合大小。rn参数名: index rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.ArgumentOutOfRangeException: 索引超出范围。必须为非负值并小于集合大小。rn参数名: indexrnrn源错误: rnrnrn行 126: rn行 127: rn行 128: string sqlstr = "delete from student where ID='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";rn行 129: strconn = ConfigurationSettings.AppSettings["dsn"];rn行 130: con = new SqlConnection(strconn);rn rn 论坛

为什么VC为单个delete也生成scalar deleting destructor?

09-28

对于对象数组而言,为了构造/析构的方便,C++编译器会生成隐藏的代理函数,来用一个for循环初始化new出来的数组,用for循环来析构delete[]的对象。这个在C++对象模型相关的书籍和文章里面都已经讲得比较清楚了。rnrn但是我有个问题,我发现VC的debug版本,为单个delete对象,也生成一个scalar deleting destructor代理函数。这个让我觉得不明白,因为我觉得没有这样的必要,单个对象的析构没有for循环,也没有析构到一半处理异常的问题。rnrn为什么VC会这样? 我贴了一下代码在这里,很简单的:rn[code=c]rnstruct Crn C()rn cout << "ctor\n";rn rn ~C()rn cout << "dtor\n";rn rn;rnint main(int argc, char *argv[])rnrn C obj;//栈对象的析构没有涉及到scalar deleting destructorrn C*p = new C();rn delete p;//这里是我的问题所在,单个对象为什么需要scalar deleting destructor?rn return 0;rn[/code]rndebug版下面生成的汇编代码如下,在main函数的尾部:rn[code=c]rn delete p;rn00E55D3F mov eax,dword ptr [p] rn00E55D42 mov dword ptr [ebp-0F8h],eax rn00E55D48 mov ecx,dword ptr [ebp-0F8h] rn00E55D4E mov dword ptr [ebp-104h],ecx rn00E55D54 cmp dword ptr [ebp-104h],0 rn00E55D5B je main+0D2h (0E55D72h) rn00E55D5D push 1 rn00E55D5F mov ecx,dword ptr [ebp-104h] rn00E55D65 call C::`scalar deleting destructor' (0E514E7h) rn00E55D6A mov dword ptr [ebp-124h],eax rn00E55D70 jmp main+0DCh (0E55D7Ch) rn00E55D72 mov dword ptr [ebp-124h],0 rn return 0;rn00E55D7C mov dword ptr [ebp-0ECh],0 rn00E55D86 mov dword ptr [ebp-4],0FFFFFFFFh rn00E55D8D lea ecx,[obj] rn00E55D90 call C::~C (0E514DDh) rn00E55D95 mov eax,dword ptr [ebp-0ECh] rn[/code]rn看到C obj的析构是在地址00E55D90 call C::~Crn而delete p的析构是在地址00E55D65 call C::`scalar deleting destructor' (0E514E7h) rn我尝试编译这个程序的release版,未优化的版本,一样的结论。rnrn问题rn1. 为什么有这个区别? 如果堆上面的对象需要一个代理函数来调用析构+free,为什么构造的时候不需要一个代理函数来malloc+构造,而在析构的时候却需要。这个显得不对称。rn2. 我用gcc也测试了一下这个程序,不加优化选项,也没有看到有个scalar deleting destructor之类的结构,加上调试信息,看反汇编也是直接callq xxxx rnrn还请板上朋友解释解释哈! 论坛

python error:[Error 10061]

12-15

刚刚开始学用Python写爬虫,按照教程写了第一个程序:rnrn # -*- coding: UTF-8 -*-rnimport urllibrnrndef demo():rn s = urllib.urlopen('http://www.baidu.com')#返回一个类文件rn print(s.read(100))#读取100个字节并输出rnrnif __name__ == '__main__':rn demo()rnrn输出以下错误,上网搜索了Traceback (most recent call last)和error10061的解决办法,但是依然没有解决,希望大家能帮帮忙。rnC:\Python27\python.exe C:/pythonProjects/urllib_demo.pyrnTraceback (most recent call last):rn File "C:/pythonProjects/urllib_demo.py", line 10, in rn demo()rn File "C:/pythonProjects/urllib_demo.py", line 6, in demorn s = urllib.urlopen('http://www.baidu.com')#返回一个类文件rn File "C:\Python27\lib\urllib.py", line 87, in urlopenrn return opener.open(url)rn File "C:\Python27\lib\urllib.py", line 213, in openrn return getattr(self, name)(url)rn File "C:\Python27\lib\urllib.py", line 350, in open_httprn h.endheaders(data)rn File "C:\Python27\lib\httplib.py", line 1038, in endheadersrn self._send_output(message_body)rn File "C:\Python27\lib\httplib.py", line 882, in _send_outputrn self.send(msg)rn File "C:\Python27\lib\httplib.py", line 844, in sendrn self.connect()rn File "C:\Python27\lib\httplib.py", line 821, in connectrn self.timeout, self.source_address)rn File "C:\Python27\lib\socket.py", line 575, in create_connectionrn raise errrnIOError: [Errno socket error] [Errno 10061] rnrnProcess finished with exit code 1rnrn 论坛

error LNK2028 & error LNK2019

05-26

WordStatProcessor.hrn[code=C/C++]rn#pragma oncernrn#include rn#include rn#include rnrnnamespace WordStat rn class WordStatProcessor rn rn public:rn void process();rn rn private:rn rn ;rnrn[/code]rnrnrnWordStatProcessor.cpprnrn[code=C/C++]rn#include "stdafx.h"rn#include "WordStatProcessor.h"rnrn#include rn#include rn#include rnrnvoid process()rnrn std::ifstream myfile ("c:/example.txt");rn std::string line;rn if (myfile.is_open())rn while (! myfile.eof() )rn std::getline (myfile,line);rn rn myfile.close();rn rnrn[/code]rnrnForm1.hrnrn[code=C/C++]rn#pragma oncernrn#include "WordStatProcessor.h"rnrnnamespace WordStat rnrn using namespace System;rn using namespace System::ComponentModel;rn using namespace System::Collections;rn using namespace System::Windows::Forms;rn using namespace System::Data;rn using namespace System::Drawing;rnrn public ref class Form1 : public System::Windows::Forms::Formrn rn public:rn Form1(void)rn rn InitializeComponent();rn rnrn protected:rn ~Form1()rn rn if (components)rn rn delete components;rn rn rn private: System::Windows::Forms::GroupBox^ groupBox1;rn protected: rn private: System::Windows::Forms::Label^ label1;rn private: System::Windows::Forms::GroupBox^ groupBox2;rn private: System::Windows::Forms::GroupBox^ groupBox3;rn private: System::Windows::Forms::ComboBox^ folderDir;rn private: System::Windows::Forms::Button^ button2;rn private: System::Windows::Forms::Label^ currentState;rn private: System::Windows::Forms::Label^ label2;rn private: System::Windows::Forms::FolderBrowserDialog^ folderBrowserDialog;rnrnrnrn private:rnrn System::ComponentModel::Container ^components;rnrn#pragma region Windows Form Designer generated codernrn void InitializeComponent(void)rn rn ....rn rn#pragma endregionrnprivate: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) rn System::Windows::Forms::DialogResult result = this->folderBrowserDialog->ShowDialog();rn if(result == System::Windows::Forms::DialogResult::OK)rn this->folderDir->Text = this->folderBrowserDialog->SelectedPath;rn rn rnprivate: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) rn WordStat::WordStatProcessor processor;rn processor.process();rn rn;rnrnrnrn[/code]rnrnrn错误rnrn1>------ Build started: Project: WordStat, Configuration: Debug Win32 ------rn1>Compiling...rn1>WordStatProcessor.cpprn1>WordStat.cpprn1>Generating Code...rn1>Linking...rn1>WordStat.obj : error LNK2028: unresolved token (0A000015) "public: void __clrcall WordStat::WordStatProcessor::process(void)" (?process@WordStatProcessor@WordStat@@$$FQAMXXZ) referenced in function "private: void __clrcall WordStat::Form1::button2_Click(class System::Object ^,class System::EventArgs ^)" (?button2_Click@Form1@WordStat@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)rn1>WordStat.obj : error LNK2019: unresolved external symbol "public: void __clrcall WordStat::WordStatProcessor::process(void)" (?process@WordStatProcessor@WordStat@@$$FQAMXXZ) referenced in function "private: void __clrcall WordStat::Form1::button2_Click(class System::Object ^,class System::EventArgs ^)" (?button2_Click@Form1@WordStat@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)rn1>D:\Projects\VisualStudio\WordStat\Debug\WordStat.exe : fatal error LNK1120: 2 unresolved externalsrn1>Build log was saved at "file://d:\Projects\VisualStudio\WordStat\WordStat\Debug\BuildLog.htm"rn1>WordStat - 3 error(s), 0 warning(s)rn========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========rnrn迷糊~~~rnrn 论坛

没有更多推荐了,返回首页